}
private ServerSocket createServerSocket(final SslConfiguration ssl, final InetAddress address2, final int passivePort) throws IOException, GeneralSecurityException {
// get server socket factory
SSLContext ctx = ssl.getSSLContext();
SSLServerSocketFactory ssocketFactory = ctx.getServerSocketFactory();
// create server socket
SSLServerSocket sslServerSocket = null;
if(address2 == null) {
sslServerSocket = (SSLServerSocket) ssocketFactory.createServerSocket(passivePort, 100);
} else {
sslServerSocket = (SSLServerSocket) ssocketFactory.createServerSocket(passivePort, 100, address2);
}
// initialize server socket
if(ssl.getClientAuth() == ClientAuth.NEED) {
sslServerSocket.setNeedClientAuth(true);