Project: Tomcat
Bug 55527 JSSESocketFactory conditionally converts alias to lower case; condition is unwise
Reported: 2013-09-05 09:05:01 | Status: resolved fixed

JSSESocketFactory conditionally converts the alias to lower case. The condition is coded as follows: private static final String defaultKeystoreType = "JKS"; ... if (JSSESocketFactory.defaultKeystoreType.equals(keystoreType)) { alias = alias.toLowerCase(Locale.ENGLISH); } If the intention is to downcase only JKS store aliases, then the comparison should be made with "JKS", not a constant that happens to contain "JKS" at present. Using a specific comparator would both clarify the code and protect against a possible change to the default (albeit very unlikely).

Files changed in fix:
java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java