Skip to content

Commit

Permalink
Fix mail ssl
Browse files Browse the repository at this point in the history
Signed-off-by: Václav Muzikář <[email protected]>
  • Loading branch information
vmuzikar committed Aug 1, 2024
1 parent ccd33d6 commit c3b4c11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@

<!--JAKARTA-->
<jakarta.mail.version>2.0.1</jakarta.mail.version>
<angus.mail.version>2.0.1</angus.mail.version>
<jakarta.xml.ws.version>4.0.0</jakarta.xml.ws.version>
<jakarta.xml.soap.version>3.0.0</jakarta.xml.soap.version>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ private void setupTruststore(Properties props) {
props.put("mail.smtp.ssl.socketFactory", factory);
if (configurator.getProvider().getPolicy() == HostnameVerificationPolicy.ANY) {
props.setProperty("mail.smtp.ssl.trust", "*");
props.put("mail.smtp.ssl.checkserveridentity", Boolean.FALSE.toString());
props.put("mail.smtp.ssl.checkserveridentity", Boolean.FALSE.toString()); // this should be the default but seems to be impl specific, so set it explicitly just to be sure
}
else {
props.put("mail.smtp.ssl.checkserveridentity", Boolean.TRUE.toString());
}
}
}
Expand Down

0 comments on commit c3b4c11

Please sign in to comment.