Skip to content

Commit

Permalink
Illegal reflective access by com.sun.mail.util.SocketFetcher eclipse-…
Browse files Browse the repository at this point in the history
…ee4j#124

Co-authored-by: jmehrens [email protected]
Co-authored-by: icu5545 [email protected]
Signed-off-by: jmehrens [email protected]
  • Loading branch information
jmehrens committed Feb 15, 2024
1 parent 3808566 commit 45a5a19
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions core/src/main/java/org/eclipse/angus/mail/util/SocketFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -632,26 +632,25 @@ private static void configureSSLSocket(Socket socket, String host,
/*
* Check server identity and trust.
* See: JDK-8062515 and JDK-7192189
* LDAPS requires the same regex handling as we need
*/
if (PropUtil.getBooleanProperty(props,
prefix + ".ssl.checkserveridentity", true)) {
// LDAP requires the same regex handling as we need
String eia = "LDAPS";
SSLParameters params = sslsocket.getSSLParameters();
params.setEndpointIdentificationAlgorithm(eia);
sslsocket.setSSLParameters(params);
String eia = PropUtil.getBooleanProperty(props,
prefix + ".ssl.checkserveridentity", true)
? "LDAPS" : (String) null;
SSLParameters params = sslsocket.getSSLParameters();
params.setEndpointIdentificationAlgorithm(eia);
sslsocket.setSSLParameters(params);

if (logger.isLoggable(Level.FINER)) {
logger.log(Level.FINER,
"Checking {0} with names {1} using"
+ " endpoint identification algorithm {2}",
new Object[]{host,
Objects.toString(params.getServerNames()), eia});
}
if (logger.isLoggable(Level.FINER)) {
logger.log(Level.FINER, "Using endpoint identification "
+ "algorithm {0} with SNIs {1} for: {2}",
new Object[]{eia, Objects.toString(
params.getServerNames()), host});
}
} catch (RuntimeException re) {
throw cleanupAndThrow(sslsocket,
new IOException("Unable to check server identity", re));
new IOException("Unable to set endpoint identification "
+ "algorithm for: " + host, re));
}

/*
Expand Down

0 comments on commit 45a5a19

Please sign in to comment.