use of com.yahoo.jdisc.http.ssl.DefaultSslKeyStoreContext in project vespa by vespa-engine.
the class ConnectorFactory method newSslConnectionFactory.
private SslConnectionFactory newSslConnectionFactory() {
Ssl sslConfig = connectorConfig.ssl();
SslContextFactory factory = new JDiscSslContextFactory();
sslKeyStoreConfigurator.configure(new DefaultSslKeyStoreContext(factory));
sslTrustStoreConfigurator.configure(new DefaultSslTrustStoreContext(factory));
switch(sslConfig.clientAuth()) {
case NEED_AUTH:
factory.setNeedClientAuth(true);
break;
case WANT_AUTH:
factory.setWantClientAuth(true);
break;
}
if (!sslConfig.prng().isEmpty()) {
factory.setSecureRandomAlgorithm(sslConfig.prng());
}
setStringArrayParameter(factory, sslConfig.excludeProtocol(), ExcludeProtocol::name, SslContextFactory::setExcludeProtocols);
setStringArrayParameter(factory, sslConfig.includeProtocol(), IncludeProtocol::name, SslContextFactory::setIncludeProtocols);
setStringArrayParameter(factory, sslConfig.excludeCipherSuite(), ExcludeCipherSuite::name, SslContextFactory::setExcludeCipherSuites);
setStringArrayParameter(factory, sslConfig.includeCipherSuite(), IncludeCipherSuite::name, SslContextFactory::setIncludeCipherSuites);
factory.setKeyManagerFactoryAlgorithm(sslConfig.sslKeyManagerFactoryAlgorithm());
factory.setProtocol(sslConfig.protocol());
return new SslConnectionFactory(factory, HttpVersion.HTTP_1_1.asString());
}
Aggregations