void configureClientSSLSocket(final Socket socket, final HostAndPort address, int timeout)
      throws IOException {
    if (socket instanceof SSLSocket) {
      final SSLSocket sslSocket = (SSLSocket) socket;

      sslSocket.setUseClientMode(true);
      sslSocket.setEnableSessionCreation(true);

      final SSLParameters parameters = sslSocket.getSSLParameters();
      checkAndEnableHostnameValidation(parameters);
      addServerNameIfNotSet(parameters, address);
      configureProtocols(true, parameters);
      configureCipherSuites(parameters);
      sslSocket.setSSLParameters(applySSLParameterExtensions(parameters));

      try {
        if (timeout > 0) {
          sslSocket.setSoTimeout(timeout);
        }
        sslSocket.startHandshake();
      }
      // Pre jkd11, startHandshake is throwing SocketTimeoutException.
      // in jdk 11 it is throwing SSLProtocolException with a cause of SocketTimeoutException.
      // this is to keep the exception consistent across jdk
      catch (SSLProtocolException ex) {
        if (ex.getCause() instanceof SocketTimeoutException) {
          throw (SocketTimeoutException) ex.getCause();
        } else {
          throw ex;
        }
      } catch (SSLHandshakeException ex) {
        String message = ex.getMessage();
        if (message != null && !message.contains("Remote host terminated the handshake")) {
          logger.fatal(String.format("Problem forming SSL connection to %s[%s].",
              socket.getInetAddress(), socket.getPort()), ex);
        }
        throw ex;
      } catch (SSLPeerUnverifiedException ex) {
        if (sslConfig.isRequireAuth()) {
          logger.fatal("SSL authentication exception.", ex);
          throw ex;
        }
      }
    }
  }
When a socket is connected to a server socket, it should be passed to this method for SSL
configuration.
geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java