public static ServerSocket createServerSocket(int port,InetAddress bindAddress) throws IOException {
  ServerSocket socket=null;
  if (SysProperties.ENABLE_ANONYMOUS_TLS) {
    removeAnonFromLegacyAlgorithms();
  }
  setKeystore();
  ServerSocketFactory f=SSLServerSocketFactory.getDefault();
  SSLServerSocket secureSocket;
  if (bindAddress == null) {
    secureSocket=(SSLServerSocket)f.createServerSocket(port);
  }
 else {
    secureSocket=(SSLServerSocket)f.createServerSocket(port,0,bindAddress);
  }
  secureSocket.setEnabledProtocols(disableSSL(secureSocket.getEnabledProtocols()));
  if (SysProperties.ENABLE_ANONYMOUS_TLS) {
    String[] list=enableAnonymous(secureSocket.getEnabledCipherSuites(),secureSocket.getSupportedCipherSuites());
    secureSocket.setEnabledCipherSuites(list);
  }
  socket=secureSocket;
  return socket;
}

public static ServerSocket createServerSocket ( int port , InetAddress bindAddress ) throws IOException { ServerSocket socket = null ; if ( SysProperties . ENABLE_ANONYMOUS_TLS ) { removeAnonFromLegacyAlgorithms ( ) ; } setKeystore ( ) ; ServerSocketFactory f = SSLServerSocketFactory . getDefault ( ) ; SSLServerSocket secureSocket ; if ( bindAddress == null ) { secureSocket = ( SSLServerSocket ) f . createServerSocket ( port ) ; } else { secureSocket = ( SSLServerSocket ) f . createServerSocket ( port , 0 , bindAddress ) ; } secureSocket . setEnabledProtocols ( disableSSL ( secureSocket . getEnabledProtocols ( ) ) ) ; if ( SysProperties . ENABLE_ANONYMOUS_TLS ) { String [ ] list = enableAnonymous ( secureSocket . getEnabledCipherSuites ( ) , secureSocket . getSupportedCipherSuites ( ) ) ; secureSocket . setEnabledCipherSuites ( list ) ; } socket = secureSocket ; return socket ; }
create a secure server socket . if a bind address is specified , the socket is only bound to this address . if h2 . enableanonymoustls is true , an attempt is made to modify the security property jdk . tls . legacyalgorithms ( in newer jvms ) to allow anonymous tls . this system change is effectively permanent for the lifetime of the jvm .
