users@glassfish.java.net

Can't specify SSLSocketFactory for STARTTLS in Javamail 1.4

From: <glassfish_at_javadesktop.org>
Date: Fri, 16 May 2008 02:09:58 PDT

In Javamail 1.3 you could specify the SSLSocketFactory to be used for the SSL socket created by the STARTTLS function by setting the system property "mail.SSLSocketFactory.class". Javamail 1.4 only allows the use of a single Session property, e.g. "mail.smtp.socketFactory.class" - this works fine for unencrypted connections, but using STARTTLS I need to specify an SSLSocketFactory so that I can establish my own certificate TrustManager for certificate verifitcation.

Javamail should probably support 2 Session properties for this:

"mail.smtp.socketFactory.class" - for the unencrypted part of the conversation
"mail.smtp.SSLSocketFactory.class" - for the encrupted part of the conversation
[Message sent by forum member 'sshort' (sshort)]

http://forums.java.net/jive/thread.jspa?messageID=274790