wernerdv commented on code in PR #13578:
URL: https://github.com/apache/ignite/pull/13578#discussion_r4004993153


##########
modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java:
##########
@@ -723,4 +754,35 @@ public static class TestSSLFactory implements 
Factory<SSLSocketFactory> {
             return getTestSslContextFactory().create().getSocketFactory();
         }
     }
+
+    /** */
+    private Set<String> supportedCipherSuites() throws Exception {

Review Comment:
   I suggest a small refactoring to deduplicate the code, but the final 
decision is yours.
   
   ```
       /** */
       private SSLSocketFactory factory(String protocol) throws Exception {
           SSLContext ctx = SSLContext.getInstance(protocol);
           ctx.init(null, null, null);
   
           return ctx.getSocketFactory();
       }
   
       /** */
       private Set<String> disabledByDefaultCipherSuites() throws Exception {
           SSLSocketFactory factory = factory("TLSv1.2");
   
           Set<String> supportedCiphersSuites = new 
HashSet<>(Arrays.stream(factory.getSupportedCipherSuites()).toList());
   
           // Fulter supported, but NOT in the default active list.
           
supportedCiphersSuites.removeAll(Set.of(factory.getDefaultCipherSuites()));
   
           // Current TC settings.
           supportedCiphersSuites.removeIf(s -> s.contains("_anon_"));
   
           assertFalse("No one disabled by default suite found", 
supportedCiphersSuites.isEmpty());
   
           return supportedCiphersSuites;
       }
   ```
   
   In JdbcThinConnectionSSLTest#testDisabledCustomCipher:
   
`assertFalse(Set.of(factory("TLS").getSupportedCipherSuites()).contains(completelyDisabledSuite));`



##########
modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSSLTest.java:
##########
@@ -333,15 +336,20 @@ public void testCustomCiphersOnServer() throws Exception {
      */
     @Test
     public void testDisabledCustomCipher() throws Exception {
+        Set<String> disabledSuites = disabledByDefaultCipherSuites();
+        String disabledSuite = disabledSuites.iterator().next();

Review Comment:
   ```suggestion
           String disabledSuite = 
disabledByDefaultCipherSuites().iterator().next();
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to