问题
Which compatible TLS
version is used by JavaMail 1.4
?
回答1:
There are four types of TLS
versions :
TLS 1.0
- It usesRFC 2246
TLS 1.1
- It usesRFC 4346
TLS 1.2
- It usesRFC 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