How to force a cipher suite in javamail?

I can't seem to find anything on how to do this. I am using a JNDI based mail provider in Websphere. As such, I am passing off some of the work of creating a connection and all to Websphere. I am able to force it to do SSL connections with no problem using things like mail.smtps.starttls.enable= true and other related parameters that get passed in fine. However, I have searched all over and I cannot find any parameters for forcing particular cipher suites. I want to be able to force a connection under only the cipher suites that are acceptable to me not what is configured on the mail server. This will ensure that my connection doesn't suddenly start going through with some weak encryption because a mail server misconfiguration surfaced. I'd rather the connection fail altogether instead of making a best effort. One can do such client side cipher suite specification in many web browsers and it appears I could do it if I was controlling the entire connection, but again it is handed off to Websphere and I want to keep it that way so I need to know what if any parameters I can pass into Websphere to specify cipher suites. Thank you in advance for any help you can provide.

[1195 byte] By [dcpapayoa] at [2007-10-3 4:56:25]
# 1
I don't think there's an easy way to do this. I think you wouldneed to provide your own socket factory that configured thison the SSLSockets it returned.
bshannona at 2007-7-14 23:01:39 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Of course not the best of news, but thank you for your time in answering my question. Hopefully Sun is monitoring this and will add this capability in next version.
dcpapayoa at 2007-7-14 23:01:39 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

This seemed pretty easy to add so I threw together a version of

JavaMail that does this. This message to javamail-announce

will tell you how to get it:

http://archives.java.sun.com/cgi-bin/wa?A2=ind0608&L=javamail-announce&F=&S=&P=75

(I just updated the version described in that message.)

You can control this by setting (e.g.) the mail.imaps.ssl.ciphersuites property.

Try it and let me know (at javamail@sun.com) if it works for you.

bshannona at 2007-7-14 23:01:40 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

FYI for those out there that might have had this problem. This new mail package does indeed work which is really cool. The only thing that hung me up for a bit was that I was comma delimiting my list of ciphers. You want to just use space delimiting such as:

SSL_RSA_WITH_RC4_128_MD5 SSL_RSA_WITH_AES_128_CBC_SHA SSL_RSA_WITH_3DES_EDE_CBC_SHA

Note that these exact cipher suites may or may not be available to you as they are from an IBM implementation list. If you are using IBM you can go here for full list:

http://www-128.ibm.com/developerworks/java/jdk/security/142/secguides/jssedocs/JSSERefGuide.html

dcpapayoa at 2007-7-14 23:01:40 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...