Source:
public Socket connect(HostAndPort addr, int timeout, ConnectionWatcher optionalWatcher, boolean allowClientSocketFactory, int socketBufferSize, boolean useSSL) throws IOException { coreSocketCreator.printConfig(); if (!useSSL) { return super.connect(addr, timeout, optionalWatcher, allowClientSocketFactory, socketBufferSize, useSSL); } if (coreSocketCreator.getSslContext() == null) { throw new GemFireConfigException( "SSL not configured correctly, Please look at previous error"); } SocketFactory sf = coreSocketCreator.getSslContext().getSocketFactory(); final Socket socket; socket = sf.createSocket(); socket.setKeepAlive(ENABLE_TCP_KEEP_ALIVE); if (socketBufferSize != -1) { socket.setReceiveBufferSize(socketBufferSize); } try { if (optionalWatcher != null) { optionalWatcher.beforeConnect(socket); } final InetSocketAddress sniProxyAddress = coreSocketCreator.getSslConfig().getSniProxyAddress(); final boolean provideSNI = sniProxyAddress != null; if (provideSNI) { logger.error("DEBUG CREATING SSL PROXY SOCKET FOR {}", addr.getHostName()); socket.connect(sniProxyAddress, Math.max(timeout, 0)); coreSocketCreator.configureClientSSLSocket(socket, timeout, sslParameters -> { final List<SNIServerName> sniHostNames = new ArrayList<>(1); sniHostNames.add(new SNIHostName(addr.getHostName())); sslParameters.setServerNames(sniHostNames); }); } else { final InetSocketAddress sockaddr; InetSocketAddress sockaddrTemp = addr.getSocketInetAddress(); if (sockaddrTemp.getAddress() == null) { final InetAddress address = InetAddress.getByName(sockaddrTemp.getHostName()); sockaddr = new InetSocketAddress(address, sockaddrTemp.getPort()); } else { sockaddr = sockaddrTemp; } socket.connect(sockaddr, Math.max(timeout, 0)); coreSocketCreator.configureClientSSLSocket(socket, timeout, _ignored -> { }); } return socket; } finally { if (optionalWatcher != null) { optionalWatcher.afterConnect(socket); } } }

Target:
public Socket connect(HostAndPort addr, int timeout, ConnectionWatcher optionalWatcher, boolean allowClientSocketFactory, int socketBufferSize, boolean useSSL) throws IOException { coreSocketCreator.printConfig(); if (!useSSL) { return super.connect(addr, timeout, optionalWatcher, allowClientSocketFactory, socketBufferSize, useSSL); } if (coreSocketCreator.getSslContext() == null) { throw new GemFireConfigException( "SSL not configured correctly, Please look at previous error"); } SocketFactory sf = coreSocketCreator.getSslContext().getSocketFactory(); final Socket socket; socket = sf.createSocket(); socket.setKeepAlive(ENABLE_TCP_KEEP_ALIVE); if (socketBufferSize != -1) { socket.setReceiveBufferSize(socketBufferSize); } try { if (optionalWatcher != null) { optionalWatcher.beforeConnect(socket); } final InetSocketAddress sniProxyAddress = coreSocketCreator.getSslConfig().getSniProxyAddress(); final boolean provideSNI = sniProxyAddress != null; if (provideSNI) { socket.connect(sniProxyAddress, Math.max(timeout, 0)); coreSocketCreator.configureClientSSLSocket(socket, timeout, sslParameters -> { final List<SNIServerName> sniHostNames = new ArrayList<>(1); sniHostNames.add(new SNIHostName(addr.getHostName())); sslParameters.setServerNames(sniHostNames); }); } else { final InetSocketAddress sockaddr; final InetSocketAddress sockaddrTemp = addr.getSocketInetAddress(); if (sockaddrTemp.getAddress() == null) { final InetAddress address = InetAddress.getByName(sockaddrTemp.getHostString()); sockaddr = new InetSocketAddress(address, sockaddrTemp.getPort()); } else { sockaddr = sockaddrTemp; } socket.connect(sockaddr, Math.max(timeout, 0)); coreSocketCreator.configureClientSSLSocket(socket, timeout, _ignored -> { }); } return socket; } finally { if (optionalWatcher != null) { optionalWatcher.afterConnect(socket); } } }