aajisaka commented on a change in pull request #1880: HADOOP-16661. Support TLS 
1.3
URL: https://github.com/apache/hadoop/pull/1880#discussion_r388758041
 
 

 ##########
 File path: 
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestSSLHttpServer.java
 ##########
 @@ -291,13 +294,30 @@ public void testExcludedCiphers() throws Exception {
   @Test
   public void testIncludedProtocols() throws Exception {
     URL url = new URL(baseUrl, SERVLET_PATH_ECHO + "?a=b&c=d");
+
+    String includedProtocols;
+    String version = System.getProperty("java.version");
+    if (version.startsWith("1.")) { // JDK 8
+      includedProtocols = INCLUDED_PROTOCOLS;
+    } else { // JDK 11 and above
+      includedProtocols = INCLUDED_PROTOCOLS_JDK11;
+    }
     HttpsURLConnection conn =
         getConnectionWithPreferredProtocolSSLSocketFactory(url,
-        INCLUDED_PROTOCOLS);
+            includedProtocols);
     assertFalse("included protocol list is empty",
-        INCLUDED_PROTOCOLS.isEmpty());
+        includedProtocols.isEmpty());
 
     readFromConnection(conn);
+
+    PreferredProtocolSSLSocketFactory factory =
+        (PreferredProtocolSSLSocketFactory)conn.getSSLSocketFactory();
+
+    if (version.startsWith("1.")) {
+      assertEquals("TLSv1.2", factory.getSocket().getSession().getProtocol());
+    } else {
+      assertEquals("TLSv1.3", factory.getSocket().getSession().getProtocol());
+    }
 
 Review comment:
   This lines can be fixed as well.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to