TLS hostname verification #189
sharky5102-cyber
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi.
Seems that the TLS hostname verification state in Angus Mail is not great at the moment. The summary is, AFAICS:
So it seems like the default for users setting mail.smtp.ssl.checkserveridentity = True is to actually not check anything. And then if you set it to "sun.security.util.HostnameChecker" or "legacy" in JDK17 you might get some checking but it's not actually correct.
Am I right?
Anyway, there is a simpler solution. All we need is setEndpointIdentificationAlgorithm(). See https://gist.github.com/jfwilson/709b74000a79eb52177b#file-sslhostnametest-java-L55 .. this simply turns on TLS hostname verification during handshake, allowing us to delete all that workaround code! This makes all of the *.ssl.hostnameverifier features redundant, and we get the JDK-supported, correct, hostname verification. It's not even that much code if we put it into MailSSLSocketFactory.
Ideas ?
Beta Was this translation helpful? Give feedback.
All reactions