开发者

Get SSL version from smtp server in Javamail

I recently upgraded to new JavaMail 1.4 and i can't connect to smtp.gmail.com over ssl.

This line works before javamail upgrade:

props.put("mail.smtp.ssl.protocols", "ssl");

Now it need to look like this:

p开发者_开发知识库rops.put("mail.smtp.ssl.protocols", "sslv3");

or

props.put("mail.smtp.ssl.protocols", "tlsv1"); 

This doesn't work:

props.put("mail.smtp.ssl.protocols", "tls");

My question is:

  1. Why previous version could work?
  2. How to get SSL version from server so i could switch to it properly?


Just leave it out. Java will figure it out.

Those protocol names should be in uppercase as far as I know,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜