* to build and initialise an SSLContext internally). Jetty's
* SslSelectChannelConnector does not have a setSslContext method
* yet, so we override its createSSLContext() method for this
* purpose.
*/
SslSelectChannelConnector nioResult;
if (sslContextFactory == null) {
nioResult = new SslSelectChannelConnector();
nioResult.setKeyPassword(getKeyPassword());
nioResult.setKeystore(getKeystorePath());
nioResult.setKeystoreType(getKeystoreType());
nioResult.setPassword(getKeystorePassword());
nioResult.setProtocol(getSslProtocol());
nioResult.setProvider(getSecurityProvider());
nioResult.setSecureRandomAlgorithm(getSecureRandomAlgorithm());
nioResult.setSslKeyManagerFactoryAlgorithm(getCertAlgorithm());
nioResult
.setSslTrustManagerFactoryAlgorithm(getCertAlgorithm());
nioResult.setTrustPassword(getKeystorePassword());
} else {
nioResult = new SslSelectChannelConnector() {
@Override
protected SSLContext createSSLContext() throws Exception {
return sslContextFactory.createSslContext();
}
};
}
if (isNeedClientAuthentication()) {
nioResult.setNeedClientAuth(true);
} else if (isWantClientAuthentication()) {
nioResult.setWantClientAuth(true);
}
if (excludedCipherSuites != null) {
nioResult.setExcludeCipherSuites(excludedCipherSuites);
}
result = nioResult;
break;
case 2: