This is an automated email from the ASF dual-hosted git repository. markt-asf pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 184ccc372aee7913cac643b17f72152ec242f936 Author: Mark Thomas <[email protected]> AuthorDate: Tue Oct 20 18:00:06 2026 +0100 Follow-up to "Fix broken SNI fallback for ClientHello values larger..." Port fix to NIO2. --- java/org/apache/tomcat/util/net/SecureNio2Channel.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/java/org/apache/tomcat/util/net/SecureNio2Channel.java b/java/org/apache/tomcat/util/net/SecureNio2Channel.java index 862f93c87e..3a04470018 100644 --- a/java/org/apache/tomcat/util/net/SecureNio2Channel.java +++ b/java/org/apache/tomcat/util/net/SecureNio2Channel.java @@ -405,6 +405,8 @@ public class SecureNio2Channel extends Nio2Channel { String hostName = null; List<Cipher> clientRequestedCiphers = null; List<String> clientRequestedApplicationProtocols = null; + List<String> clientRequestedProtocols = null; + List<String> clientRequestedCipherNames = null; List<Group> clientSupportedGroups = null; List<SignatureScheme> clientSignatureSchemes = null; switch (extractor.getResult()) { @@ -415,6 +417,8 @@ public class SecureNio2Channel extends Nio2Channel { //$FALL-THROUGH$ to set the client requested ciphers case NOT_PRESENT: clientRequestedCiphers = extractor.getClientRequestedCiphers(); + clientRequestedProtocols = extractor.getClientRequestedProtocols(); + clientRequestedCipherNames = extractor.getClientRequestedCipherNames(); clientSupportedGroups = extractor.getClientSupportedGroups(); clientSignatureSchemes = extractor.getClientSignatureSchemes(); break; @@ -429,6 +433,11 @@ public class SecureNio2Channel extends Nio2Channel { } hostName = endpoint.getDefaultSSLHostConfigName(); clientRequestedCiphers = Collections.emptyList(); + clientRequestedApplicationProtocols = Collections.emptyList(); + clientRequestedProtocols = Collections.emptyList(); + clientRequestedCipherNames = Collections.emptyList(); + clientSupportedGroups = Collections.emptyList(); + clientSignatureSchemes = Collections.emptyList(); break; case NON_SECURE: netOutBuffer.clear(); @@ -443,7 +452,7 @@ public class SecureNio2Channel extends Nio2Channel { } try { - AbstractJsseEndpoint.clientRequestedProtocolsThreadLocal.set(extractor.getClientRequestedProtocols()); + AbstractJsseEndpoint.clientRequestedProtocolsThreadLocal.set(clientRequestedProtocols); AbstractJsseEndpoint.clientSupportedGroupsThreadLocal.set(clientSupportedGroups); AbstractJsseEndpoint.clientSignatureSchemesThreadLocal.set(clientSignatureSchemes); sslEngine = endpoint.createSSLEngine(hostName, clientRequestedCiphers, clientRequestedApplicationProtocols); @@ -455,9 +464,8 @@ public class SecureNio2Channel extends Nio2Channel { // Populate additional TLS attributes obtained from the handshake that // aren't available from the session - additionalTlsAttributes.put(SSLSupport.REQUESTED_PROTOCOL_VERSIONS_KEY, - extractor.getClientRequestedProtocols()); - additionalTlsAttributes.put(SSLSupport.REQUESTED_CIPHERS_KEY, extractor.getClientRequestedCipherNames()); + additionalTlsAttributes.put(SSLSupport.REQUESTED_PROTOCOL_VERSIONS_KEY, clientRequestedProtocols); + additionalTlsAttributes.put(SSLSupport.REQUESTED_CIPHERS_KEY, clientRequestedCipherNames); // Ensure the application buffers (which have to be created earlier) are // big enough. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
