tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1845495 - /tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java
Date Thu, 01 Nov 2018 16:14:21 GMT
Author: markt
Date: Thu Nov  1 16:14:21 2018
New Revision: 1845495

URL: http://svn.apache.org/viewvc?rev=1845495&view=rev
Log:
Force TLS 1.2 if TLS 1.3 is available as JSSE's TLS 1.3 implementation doesn't support Post
Handshake Authentication which is required for this test to pass.

Modified:
    tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java?rev=1845495&r1=1845494&r2=1845495&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java Thu Nov  1 16:14:21 2018
@@ -39,6 +39,7 @@ import org.apache.catalina.startup.Teste
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
 import org.apache.tomcat.util.buf.ByteChunk;
+import org.apache.tomcat.util.compat.TLS;
 import org.apache.tomcat.websocket.server.WsContextListener;
 
 /**
@@ -109,7 +110,15 @@ public class TestSsl extends TomcatBaseT
 
         tomcat.start();
 
-        SSLContext sslCtx = SSLContext.getInstance("TLS");
+        SSLContext sslCtx;
+        if (TLS.isTlsv13Available()) {
+            // Force TLS 1.2 if TLS 1.3 is available as JSSE's TLS 1.3
+            // implementation doesn't support Post Handshake Authentication
+            // which is required for this test to pass.
+            sslCtx = SSLContext.getInstance("TLSv1.2");
+        } else {
+            sslCtx = SSLContext.getInstance("TLS");
+        }
         sslCtx.init(null, TesterSupport.getTrustManagers(), null);
         SSLSocketFactory socketFactory = sslCtx.getSocketFactory();
         SSLSocket socket = (SSLSocket) socketFactory.createSocket("localhost",



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


Mime
View raw message