Which version of TLS is supported by JavaMail 1.4?

谁都会走 提交于 2020-12-06 08:47:33

问题


Which compatible TLS version is used by JavaMail 1.4 ?


回答1:


There are four types of TLS versions :

  • TLS 1.0 - It uses RFC 2246
  • TLS 1.1 - It uses RFC 4346
  • TLS 1.2 - It uses RFC 5246
  • TLS 1.3 - It is in development.

According to JavaMail 1.4 Docs, it uses RFC 2231, which is coming under TLSv1.0 version RFC series.

So, it can be concluded that TLSv1.0 is only supported by JavaMail 1.4.

Check docs for more information.




回答2:


Mail servers may be temporarily offline, so unless you want to go through all the headache of having your java program save emails and retry later, it is highly recommended to not use JavaMail to send email across the web.

Have JavaMail send to a local SMTP server, preferably a simple SMTP relay server installed in the same machine where Java is running.

That way:

  • SMTP server is always available, so no retry logic needed in Java.

  • SMTP server is fast, with low latency, so optimal performance for sending emails.

  • No need for TLS from Java program to local SMTP server. The SMTP server can use TLS when routing the email to the destination.

Both Windows Server and Linux comes with SMTP services, you just need to install them.



来源:https://stackoverflow.com/questions/58638567/which-version-of-tls-is-supported-by-javamail-1-4

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!