Search in sources :

Example 1 with DefaultSslKeyStoreContext

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());
}
Also used : ExcludeProtocol(com.yahoo.jdisc.http.ConnectorConfig.Ssl.ExcludeProtocol) DefaultSslTrustStoreContext(com.yahoo.jdisc.http.ssl.DefaultSslTrustStoreContext) SslContextFactory(org.eclipse.jetty.util.ssl.SslContextFactory) DefaultSslKeyStoreContext(com.yahoo.jdisc.http.ssl.DefaultSslKeyStoreContext) IncludeProtocol(com.yahoo.jdisc.http.ConnectorConfig.Ssl.IncludeProtocol) IncludeCipherSuite(com.yahoo.jdisc.http.ConnectorConfig.Ssl.IncludeCipherSuite) ExcludeCipherSuite(com.yahoo.jdisc.http.ConnectorConfig.Ssl.ExcludeCipherSuite) SslConnectionFactory(org.eclipse.jetty.server.SslConnectionFactory) Ssl(com.yahoo.jdisc.http.ConnectorConfig.Ssl)

Aggregations

Ssl (com.yahoo.jdisc.http.ConnectorConfig.Ssl)1 ExcludeCipherSuite (com.yahoo.jdisc.http.ConnectorConfig.Ssl.ExcludeCipherSuite)1 ExcludeProtocol (com.yahoo.jdisc.http.ConnectorConfig.Ssl.ExcludeProtocol)1 IncludeCipherSuite (com.yahoo.jdisc.http.ConnectorConfig.Ssl.IncludeCipherSuite)1 IncludeProtocol (com.yahoo.jdisc.http.ConnectorConfig.Ssl.IncludeProtocol)1 DefaultSslKeyStoreContext (com.yahoo.jdisc.http.ssl.DefaultSslKeyStoreContext)1 DefaultSslTrustStoreContext (com.yahoo.jdisc.http.ssl.DefaultSslTrustStoreContext)1 SslConnectionFactory (org.eclipse.jetty.server.SslConnectionFactory)1 SslContextFactory (org.eclipse.jetty.util.ssl.SslContextFactory)1