Search in sources :

Example 1 with SslSocketConnector

use of org.eclipse.jetty.server.ssl.SslSocketConnector in project storm by apache.

the class UIHelpers method mkSslConnector.

private static SslSocketConnector mkSslConnector(Integer port, String ksPath, String ksPassword, String ksType, String keyPassword, String tsPath, String tsPassword, String tsType, Boolean needClientAuth, Boolean wantClientAuth) {
    SslContextFactory factory = new SslContextFactory();
    factory.setExcludeCipherSuites("SSL_RSA_WITH_RC4_128_MD5", "SSL_RSA_WITH_RC4_128_SHA");
    factory.setExcludeProtocols("SSLv3");
    factory.setAllowRenegotiate(false);
    factory.setKeyStorePath(ksPath);
    factory.setKeyStoreType(ksType);
    factory.setKeyStorePassword(ksPassword);
    factory.setKeyManagerPassword(keyPassword);
    if (tsPath != null && tsPassword != null && tsType != null) {
        factory.setTrustStore(tsPath);
        factory.setTrustStoreType(tsType);
        factory.setTrustStorePassword(tsPassword);
    }
    if (needClientAuth != null && needClientAuth) {
        factory.setNeedClientAuth(true);
    } else if (wantClientAuth != null && wantClientAuth) {
        factory.setWantClientAuth(true);
    }
    SslSocketConnector sslConnector = new SslSocketConnector(factory);
    sslConnector.setPort(port);
    return sslConnector;
}
Also used : SslContextFactory(org.eclipse.jetty.util.ssl.SslContextFactory) SslSocketConnector(org.eclipse.jetty.server.ssl.SslSocketConnector)

Example 2 with SslSocketConnector

use of org.eclipse.jetty.server.ssl.SslSocketConnector in project h2o-3 by h2oai.

the class JettyHTTPD method startHttps.

/**
   * This implementation is based on http://blog.denevell.org/jetty-9-ssl-https.html
   *
   * @throws Exception
   */
private void startHttps() throws Exception {
    _server = new Server();
    SslContextFactory sslContextFactory = new SslContextFactory(H2O.ARGS.jks);
    sslContextFactory.setKeyStorePassword(H2O.ARGS.jks_pass);
    SslSocketConnector httpsConnector = new SslSocketConnector(sslContextFactory);
    if (getIp() != null) {
        httpsConnector.setHost(getIp());
    }
    httpsConnector.setPort(getPort());
    createServer(httpsConnector);
}
Also used : SslContextFactory(org.eclipse.jetty.util.ssl.SslContextFactory) SslSocketConnector(org.eclipse.jetty.server.ssl.SslSocketConnector) RequestServer(water.api.RequestServer) Server(org.eclipse.jetty.server.Server)

Aggregations

SslSocketConnector (org.eclipse.jetty.server.ssl.SslSocketConnector)2 SslContextFactory (org.eclipse.jetty.util.ssl.SslContextFactory)2 Server (org.eclipse.jetty.server.Server)1 RequestServer (water.api.RequestServer)1