Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
Rename helper function to prepareSocket
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpherrinm committed May 10, 2016
1 parent 5a89556 commit c4a59c0
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -33,7 +33,7 @@ final class EndpointIdentificationSocketFactory extends SocketFactory {
this.factory = factory; this.factory = factory;
} }


private Socket setEndpoint(Socket socket) { private Socket prepareSocket(Socket socket) {
SSLSocket sslSocket = (SSLSocket)socket; SSLSocket sslSocket = (SSLSocket)socket;
SSLParameters parameters = sslSocket.getSSLParameters(); SSLParameters parameters = sslSocket.getSSLParameters();
parameters.setEndpointIdentificationAlgorithm("LDAPS"); parameters.setEndpointIdentificationAlgorithm("LDAPS");
Expand All @@ -43,23 +43,23 @@ private Socket setEndpoint(Socket socket) {


@Override @Override
public Socket createSocket(String host, int port) throws IOException { public Socket createSocket(String host, int port) throws IOException {
return setEndpoint(factory.createSocket(host, port)); return prepareSocket(factory.createSocket(host, port));
} }


@Override @Override
public Socket createSocket(String host, int port, InetAddress localAddress, int localPort) public Socket createSocket(String host, int port, InetAddress localAddress, int localPort)
throws IOException { throws IOException {
return setEndpoint(factory.createSocket(host, port, localAddress, localPort)); return prepareSocket(factory.createSocket(host, port, localAddress, localPort));
} }


@Override @Override
public Socket createSocket(InetAddress inetAddress, int port) throws IOException { public Socket createSocket(InetAddress inetAddress, int port) throws IOException {
return setEndpoint(factory.createSocket(inetAddress, port)); return prepareSocket(factory.createSocket(inetAddress, port));
} }


@Override @Override
public Socket createSocket(InetAddress inetAddress, int port, InetAddress localAddress, int localPort) public Socket createSocket(InetAddress inetAddress, int port, InetAddress localAddress, int localPort)
throws IOException { throws IOException {
return setEndpoint(factory.createSocket(inetAddress, port, localAddress, localPort)); return prepareSocket(factory.createSocket(inetAddress, port, localAddress, localPort));
} }
} }

0 comments on commit c4a59c0

Please sign in to comment.