开发者

Get SSL version from smtp server in Javamail

开发者 https://www.devze.com 2023-02-25 12:35 出处:网络
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:

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

精彩评论

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