-
-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API bugfix: server identity verification should not be tied to host trusting #221
Comments
What you are saying sounds reasonable, but unfortunately I'm not an expert on the topic of SSL and this particular issue seems to stem from the SSL support in the underlying JavaMail library. Maybe we can page @cbarcenas and see if he has better understanding, he's been a great help in the past on similar topics. |
(Sorry, pressed wrong button) @bbottema @cbarcenas the docs for
So in both cases "no validation" should happen which IMHO should imply mail.smtps.ssl.checkserveridentity=false |
After conducting a source code review of JavaMail, it seems these properties serve different purposes and its exposure in Simple Java Mail misaligned (and mail.smtps.ssl.checkserveridentity is not implied by trusting a host!). Trusting a host means that after verifying its identity, you say you don't distrust it. If you leave it empty, you trust it by default. It's like an optional whitelist, but is not related to verifying the server's identity using SSL keys. Knowing this, I'm thinking what is the best way to expose this API better. Would it make sense to expose both features separately, or roll it all into one method (like the current |
I think I will split it up in two methods: one to enable/disable server identity checks using SSL key and one that enables the whitelist for hosts (not related to SSL). |
@floragunncom, I've released 5.4.0-SNAPSHOT with the API split up, that fixes your issue (you'll need to add the snapshot repo). You can now do:
Probably you don't need to touch Can you verify this solved your issue, @floragunncom? |
+1, thx |
5.4.0 released. |
Simple Java Mail Version: 5.2.0
If I connect to a SMTP server on localhost with a self signed certificate and setting
MailerBuilder.trustingAllHosts(true)
and/orMailerBuilder.trustingSSLHosts(new String[]{"*"})
get an "Can't verify identity of server: 127.0.0.1" exception:I can fix it with
MailerBuilder..withProperty("mail.smtps.ssl.checkserveridentity", "false")
but for me it looks thatMailerBuilder.trustingAllHosts(true)
and/orMailerBuilder.trustingSSLHosts(new String[]{"*"})
should imply this?The text was updated successfully, but these errors were encountered: