I have a strange error, I can reproduce but which I can't quite figure out the cause or solution to.
vitals: javamail 1.4.4, Windows Server 2003, JBoss.
So, I have a pretty large stack trace I won't include (yet), but it starts with a NoSuchAlgorithmException. This is tripped when I send an email to gmail servers using TLS or SSL encryption. Exact same EAR on Windows Server 2008, works fine.
Please read that again: using the same EAR & the same parameters to send the email under 2008, it gets where it needs fine. So, I'm pretty sure I have the ports/smtp server/etc nailed.
Have looked into a lot of possibilities, nothing has panned out.
Solution would be great, direction or thoughts would be enough.
It looks like there's a difference in the security configuration of the two machines.
Are you using the same JDK version on both machines? It looks like one of the
machines isn't trusting the Gmail server's certificate. Possibly the different app
server instances have configured the trust store differently?
both machines do have the same jdk. our application installs everything it needs, and then uses that version.
and it definitely seems like either it's not trusting something it's getting from the gmail servers, or it's unable to understand what it's getting. snippet of stack trace below. why might that be happening in 2003 and not in 2008?
also, i've looked at a couple of questions on stackoverflow (http://stackoverflow.com/questions/6365209/java-and-ssl-java-security-nosuchalgorithmexception), and i confirmed the policy files are the unlimited strength versions. not much luck.
javax.mail.MessagingException: Could not convert socket to TLS;
nested exception is:
java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl)
**** redacted ****
.. 14 more
Caused by: java.security.cert.CertificateParsingException: signed overrun, bytes = 257
at sun.security.x509.X509CertImpl.parse(Unknown Source)
at sun.security.x509.X509CertImpl.<init>(Unknown Source)
at sun.security.provider.X509Factory.engineGenerateCertificate(Unknown Source)
at java.security.cert.CertificateFactory.generateCertificate(Unknown Source)
at sun.security.provider.JavaKeyStore.engineLoad(Unknown Source)
at sun.security.provider.JavaKeyStore$JKS.engineLoad(Unknown Source)
at java.security.KeyStore.load(Unknown Source)
at com.sun.net.ssl.internal.ssl.TrustManagerFactoryImpl.getCacertsKeyStore(Unknown Source)
at com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl.getDefaultTrustManager(Unknown Source)
at com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
... 21 more