5 Replies Latest reply: Dec 6, 2011 3:40 PM by EJP RSS

    Transport.send - No trusted certificate found

    jl1997
      I'm new to JAVA and am writing a small program to send an email, I am getting the following error:

      javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found

      My program works agains gmail.com, but does not work against the actual server we need to communicate with.

      Any help would be appreciated.

      Thanks
      Jim
        • 1. Re: Transport.send - No trusted certificate found
          EJP
          Can you post the complete stack trace. Can you also run your client with -Djavax.net.debug=ssl,handshake and post the results.
          • 2. Re: Transport.send - No trusted certificate found
            jl1997
            Having problems posting the stack trace, getting error that regarding an invalid "tag", so I will post the last part of the stack trace for now.

            ---

            main, SEND TLSv1 ALERT: fatal, description = certificate_unknown
            main, WRITE: TLSv1 Alert, length = 2
            main, called closeSocket()
            main, handling exception: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
            Exception in thread "main" java.lang.RuntimeException: javax.mail.SendFailedException: Sending failed;
            nested exception is:
            class javax.mail.MessagingException: Exception reading response;
            nested exception is:
            javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
            at SendEmail.main(SendEmail.java:86)
            Caused by: javax.mail.SendFailedException: Sending failed;
            nested exception is:
            class javax.mail.MessagingException: Exception reading response;
            nested exception is:
            javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
            at javax.mail.Transport.send0(Transport.java:218)
            at javax.mail.Transport.send(Transport.java:80)
            at SendEmail.main(SendEmail.java:79)
            • 3. Re: Transport.send - No trusted certificate found
              jl1997
              Here is more information:

              init context
              trigger seeding of SecureRandom
              done seeding SecureRandom
              %% No cached client session
              *** ClientHello, TLSv1
              RandomCookie: GMT: 1306404811 bytes = { 185, 232, 223, 37, 10, 115, 250, 16, 53, 131, 64, 115, 123, 29, 61, 233, 1, 188, 244, 15, 238, 199, 24, 238, 95, 8, 12, 103 }
              Session ID: {}
              Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL
              _DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_
              WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA]
              Compression Methods: { 0 }
              ***
              main, WRITE: TLSv1 Handshake, length = 73
              main, WRITE: SSLv2 client hello message, length = 98
              main, READ: TLSv1 Handshake, length = 74
              *** ServerHello, TLSv1
              RandomCookie: GMT: 1306405232 bytes = { 113, 129, 102, 7, 95, 139, 186, 153, 59, 116, 125, 212, 35, 133, 85, 145, 196, 19, 247, 114, 11, 236, 95, 220, 101, 42, 99, 133 }
              Session ID: {22, 113, 58, 13, 152, 23, 181, 238, 203, 92, 106, 126, 151, 65, 241, 188, 198, 76, 253, 99, 182, 90, 118, 2, 14, 154, 163, 14, 213, 101, 151, 169}
              Cipher Suite: SSL_RSA_WITH_RC4_128_MD5
              Compression Method: 0
              ***
              %% Created: [Session-1, SSL_RSA_WITH_RC4_128_MD5]
              ** SSL_RSA_WITH_RC4_128_MD5
              main, READ: TLSv1 Handshake, length = 1241
              *** Certificate chain
              • 4. Re: Transport.send - No trusted certificate found
                jl1997
                More information:

                chain [0] = [
                [
                Version: V3
                Subject: EMAILADDRESS=ssl@host.arrowwebsites.com, CN=host.arrowwebsites.com, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=US
                Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5

                Key: SunJSSE RSA public key:
                public exponent:
                010001
                modulus:
                c79172e1 798e717c 88053500 bab2f951 cc9e4b60 334b65e6 c0e53cc8 c10d55fc
                1616fa31 5a7e1fba b7947bcc b010ebfd 27831514 f2f65b78 5e9854f4 04dca769
                8ef9da4b f2180615 a843c128 26c247b7 2dbf145a 1a430b87 1bc19429 d3edebf1
                2bf8526a 355211f5 827a13d5 08c9ce36 cd691d54 8b0f7019 10cea214 6a49c797
                8e5eb500 6721cd9c ffea184d 8ed0c165 be9e0758 6cfe7ae6 75d703c2 df850550
                77a261a0 00514682 658653fc a15deda9 78ff955e 3169a225 2858c13e a7e9be61
                c61f3af8 af39f84c e3b071ed 63b8d00e 0d736114 e273ecc7 3be8f59c cd33c63e
                1306a3f9 95360f86 dbf2ab41 36aad5e2 8e7beab9 594e21e6 b51a3758 25211067
                Validity: [From: Tue Aug 02 02:33:05 EDT 2011,
                               To: Wed Aug 01 02:33:05 EDT 2012]
                Issuer: EMAILADDRESS=ssl@host.arrowwebsites.com, CN=host.arrowwebsites.com, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=US
                SerialNumber: [    019320c1 5c]

                Certificate Extensions: 3
                [1]: ObjectId: 2.5.29.14 Criticality=false
                SubjectKeyIdentifier [
                KeyIdentifier [
                0000: 19 CF 4B C9 3C DC 8D F7 0C A5 64 F8 30 16 34 95 ..K.<.....d.0.4.
                0010: 7A 64 B5 A4 zd..
                ]
                ]
                • 5. Re: Transport.send - No trusted certificate found
                  EJP
                  I would say that's a self-signed certificate and your truststore doesn't trust it.