* Creates the SSL ServerSocket.
*/
public QServerSocket create(InetAddress host, int port)
throws IOException, GeneralSecurityException
{
SSLServerSocketFactory factory = null;
if (_keyStore != null) {
SSLContext sslContext = SSLContext.getInstance(_sslContext);
KeyManagerFactory kmf
= KeyManagerFactory.getInstance(_keyManagerFactory);
kmf.init(_keyStore, _password.toCharArray());
sslContext.init(kmf.getKeyManagers(), null, null);
/*
if (_cipherSuites != null)
sslContext.createSSLEngine().setEnabledCipherSuites(_cipherSuites);
if (_protocols != null)
sslContext.createSSLEngine().setEnabledProtocols(_protocols);
*/
factory = sslContext.getServerSocketFactory();
}
else {
factory = createAnonymousFactory(host, port);
}
ServerSocket serverSocket;
int listen = 100;
if (host == null)
serverSocket = factory.createServerSocket(port, listen);
else
serverSocket = factory.createServerSocket(port, listen, host);
SSLServerSocket sslServerSocket = (SSLServerSocket) serverSocket;
if (_cipherSuites != null) {
sslServerSocket.setEnabledCipherSuites(_cipherSuites);