@Override
public ServerSocket createServerSocket(int port, int backlog, InetAddress ifAddress) throws IOException
{
initSSLContext();
SSLServerSocketFactory factory = sslCtx.getServerSocketFactory();
SSLServerSocket socket = (SSLServerSocket) factory.createServerSocket(port, backlog, ifAddress);
SSLSessionContext ctx = sslCtx.getServerSessionContext();
if (log.isDebugEnabled())
{
log.debug(ctx);
String[] supportedProtocols = socket.getSupportedProtocols();
log.debug("Supported protocols: " + Arrays.asList(supportedProtocols));
String[] supportedCipherSuites = socket.getSupportedCipherSuites();
log.debug("Supported CipherSuites: " + Arrays.asList(supportedCipherSuites));
}
socket.setNeedClientAuth(isNeedsClientAuth());
if (!isNeedsClientAuth())
{
socket.setWantClientAuth(wantsClientAuth);
}
if (protocols != null)
socket.setEnabledProtocols(protocols);
if (cipherSuites != null)
socket.setEnabledCipherSuites(cipherSuites);
DomainServerSocket handler = new DomainServerSocket(socket);
ProxyFactory pf = new ProxyFactory();
pf.setHandler(handler);
pf.setSuperclass(SSLServerSocket.class);
Class[] sig = {};
Object[] args = {};
SSLServerSocket proxy = null;
try
{
proxy = (SSLServerSocket) pf.create(sig, args);
}
catch (Exception e)