diff --git a/pom.xml b/pom.xml
index 95910eab9050..7ce7d062b9ff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,7 +104,6 @@
2.0.1
- 2.0.1
4.0.0
3.0.0
diff --git a/services/src/main/java/org/keycloak/email/DefaultEmailSenderProvider.java b/services/src/main/java/org/keycloak/email/DefaultEmailSenderProvider.java
index 41609a5ead98..9b6f20b68bab 100644
--- a/services/src/main/java/org/keycloak/email/DefaultEmailSenderProvider.java
+++ b/services/src/main/java/org/keycloak/email/DefaultEmailSenderProvider.java
@@ -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());
}
}
}