This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit bedc995cb347a1f5fc60bc524c819ce36e58b972
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Jan 28 09:50:22 2021 +0000

    Ensure the extracted SNI host name is always lower case
    
    This is the second part of the fix to make mapping of SNI values to SSL
    virtual hosts case insensitive.
---
 java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java 
b/java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java
index 54ea3f0..28d3358 100644
--- a/java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java
+++ b/java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java
@@ -22,6 +22,7 @@ import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Locale;
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -196,6 +197,10 @@ public class TLSClientHelloExtractor {
     }
 
 
+    /**
+     * @return The SNI value provided by the client converted to lower case if
+     *         not already lower case.
+     */
     public String getSNIValue() {
         if (result == ExtractorResult.COMPLETE) {
             return sniValue;
@@ -399,7 +404,7 @@ public class TLSClientHelloExtractor {
         char serverNameSize = bb.getChar();
         byte[] serverNameBytes = new byte[serverNameSize];
         bb.get(serverNameBytes);
-        return new String(serverNameBytes, StandardCharsets.UTF_8);
+        return new String(serverNameBytes, 
StandardCharsets.UTF_8).toLowerCase(Locale.ENGLISH);
     }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to