public Socket createSocket(String host, int port) throws IOException {
   Socket s = this.factory.createSocket(host, port);
   if (s instanceof SSLSocket) {
     SSLSocket ssl = (SSLSocket) s;
     ssl.setUseClientMode(false); // client offers to authenticate itself
     ssl.setNeedClientAuth(true);
   }
   return s;
 }
 public Socket createSocket(
     InetAddress address, int port, InetAddress clientAddress, int clientPort) throws IOException {
   Socket s = this.factory.createSocket(address, port, clientAddress, clientPort);
   if (s instanceof SSLSocket) {
     SSLSocket ssl = (SSLSocket) s;
     ssl.setUseClientMode(false); // client offers to authenticate itself
     ssl.setNeedClientAuth(true);
   }
   return s;
 }