spuru9 commented on code in PR #28553:
URL: https://github.com/apache/flink/pull/28553#discussion_r3534841476


##########
flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java:
##########
@@ -524,4 +562,60 @@ private void configureServerSocket(SSLServerSocket socket) 
{
             socket.setNeedClientAuth(true);
         }
     }
+
+    /**
+     * A {@link javax.net.SocketFactory} that applies operator-configured TLS 
protocols and cipher
+     * suites to every client socket it creates. This mirrors {@link
+     * ConfiguringSSLServerSocketFactory} for the client (BlobClient) side.
+     */
+    private static class ConfiguringSSLClientSocketFactory extends 
SocketFactory {
+
+        private final SSLSocketFactory sslSocketFactory;
+        private final String[] protocols;
+        private final String[] cipherSuites;
+
+        ConfiguringSSLClientSocketFactory(
+                SSLSocketFactory sslSocketFactory, String[] protocols, 
String[] cipherSuites) {
+            this.sslSocketFactory = sslSocketFactory;
+            this.protocols = protocols;
+            this.cipherSuites = cipherSuites;
+        }
+
+        @Override
+        public Socket createSocket() throws IOException {
+            return configureSocket((SSLSocket) 
sslSocketFactory.createSocket());
+        }
+
+        @Override
+        public Socket createSocket(String host, int port) throws IOException {
+            return configureSocket((SSLSocket) 
sslSocketFactory.createSocket(host, port));
+        }
+
+        @Override
+        public Socket createSocket(String host, int port, InetAddress 
localHost, int localPort)
+                throws IOException {
+            return configureSocket(
+                    (SSLSocket) sslSocketFactory.createSocket(host, port, 
localHost, localPort));
+        }
+
+        @Override
+        public Socket createSocket(InetAddress host, int port) throws 
IOException {
+            return configureSocket((SSLSocket) 
sslSocketFactory.createSocket(host, port));
+        }
+
+        @Override
+        public Socket createSocket(
+                InetAddress address, int port, InetAddress localAddress, int 
localPort)
+                throws IOException {
+            return configureSocket(
+                    (SSLSocket)
+                            sslSocketFactory.createSocket(address, port, 
localAddress, localPort));
+        }
+
+        private SSLSocket configureSocket(javax.net.ssl.SSLSocket socket) {

Review Comment:
   SSLSocket is already imported, no need for the FQN here.
   ```suggestion
           private SSLSocket configureSocket(SSLSocket socket) {
   ```



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