}
return answer;
}
protected SslSelectChannelConnector createSslSocketConnector(JettyHttpEndpoint endpoint) throws Exception {
SslSelectChannelConnector answer = null;
// Note that this was set on the endpoint when it was constructed. It was
// either explicitly set at the component or on the endpoint, but either way,
// the value is already set. We therefore do not need to look at the component
// level SSLContextParameters again in this method.
SSLContextParameters endpointSslContextParameters = endpoint.getSslContextParameters();
if (endpointSslContextParameters != null) {
SslContextFactory contextFact = new SslContextFactory() {
// This method is for Jetty 7.0.x ~ 7.4.x
@SuppressWarnings("unused")
public boolean checkConfig() {
if (getSslContext() == null) {
return checkSSLContextFactoryConfig(this);
} else {
return true;
}
}
// This method is for Jetty 7.5.x
public void checkKeyStore() {
// here we don't check the SslContext as it is already created
}
};
contextFact.setSslContext(endpointSslContextParameters.createSSLContext());
for (Constructor<?> c : SslSelectChannelConnector.class.getConstructors()) {
if (c.getParameterTypes().length == 1
&& c.getParameterTypes()[0].isInstance(contextFact)) {
answer = (SslSelectChannelConnector)c.newInstance(contextFact);
}
}
} else {
answer = new SslSelectChannelConnector();
// with default null values, jetty ssl system properties
// and console will be read by jetty implementation
String keystoreProperty = System.getProperty(JETTY_SSL_KEYSTORE);
if (keystoreProperty != null) {