当前位置: 首页>>代码示例>>Java>>正文


Java SslContextFactory.setIncludeProtocols方法代码示例

本文整理汇总了Java中org.eclipse.jetty.util.ssl.SslContextFactory.setIncludeProtocols方法的典型用法代码示例。如果您正苦于以下问题:Java SslContextFactory.setIncludeProtocols方法的具体用法?Java SslContextFactory.setIncludeProtocols怎么用?Java SslContextFactory.setIncludeProtocols使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jetty.util.ssl.SslContextFactory的用法示例。


在下文中一共展示了SslContextFactory.setIncludeProtocols方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configureSsl

import org.eclipse.jetty.util.ssl.SslContextFactory; //导入方法依赖的package包/类
/**
 * Configure the SSL connection.
 * @param factory the Jetty {@link SslContextFactory}.
 * @param ssl the ssl details.
 */
protected void configureSsl(SslContextFactory factory, Ssl ssl) {
	factory.setProtocol(ssl.getProtocol());
	configureSslClientAuth(factory, ssl);
	configureSslPasswords(factory, ssl);
	factory.setCertAlias(ssl.getKeyAlias());
	if (ssl.getCiphers() != null) {
		factory.setIncludeCipherSuites(ssl.getCiphers());
	}
	if (ssl.getEnabledProtocols() != null) {
		factory.setIncludeProtocols(ssl.getEnabledProtocols());
	}
	if (getSslStoreProvider() != null) {
		try {
			factory.setKeyStore(getSslStoreProvider().getKeyStore());
			factory.setTrustStore(getSslStoreProvider().getTrustStore());
		}
		catch (Exception ex) {
			throw new IllegalStateException("Unable to set SSL store", ex);
		}
	}
	else {
		configureSslKeyStore(factory, ssl);
		configureSslTrustStore(factory, ssl);
	}
}
 
开发者ID:philwebb,项目名称:spring-boot-concourse,代码行数:31,代码来源:JettyEmbeddedServletContainerFactory.java

示例2: configureSsl

import org.eclipse.jetty.util.ssl.SslContextFactory; //导入方法依赖的package包/类
/**
 * Configure the SSL connection.
 *
 * @param factory the Jetty {@link SslContextFactory}.
 * @param ssl the ssl details.
 */
protected void configureSsl(SslContextFactory factory, Ssl ssl) {
    factory.setProtocol(ssl.getProtocol());
    configureSslClientAuth(factory, ssl);
    configureSslPasswords(factory, ssl);
    factory.setCertAlias(ssl.getKeyAlias());

    if (!ObjectUtils.isEmpty(ssl.getCiphers())) {
        factory.setIncludeCipherSuites(ssl.getCiphers());
        factory.setExcludeCipherSuites();
    }

    if (ssl.getEnabledProtocols() != null) {
        factory.setIncludeProtocols(ssl.getEnabledProtocols());
    }

    if (getSslStoreProvider() != null) {
        try {
            factory.setKeyStore(getSslStoreProvider().getKeyStore());
            factory.setTrustStore(getSslStoreProvider().getTrustStore());
        } catch (Exception ex) {
            throw new IllegalStateException("Unable to set SSL store", ex);
        }
    } else {
        configureSslKeyStore(factory, ssl);
        configureSslTrustStore(factory, ssl);
    }
}
 
开发者ID:gdrouet,项目名称:nightclazz-spring5,代码行数:34,代码来源:CustomJettyReactiveWebServerFactory.java

示例3: configureSsl

import org.eclipse.jetty.util.ssl.SslContextFactory; //导入方法依赖的package包/类
/**
 * Configure the SSL connection.
 * @param factory the Jetty {@link SslContextFactory}.
 * @param ssl the ssl details.
 */
protected void configureSsl(SslContextFactory factory, Ssl ssl) {
	factory.setProtocol(ssl.getProtocol());
	configureSslClientAuth(factory, ssl);
	configureSslPasswords(factory, ssl);
	factory.setCertAlias(ssl.getKeyAlias());
	if (!ObjectUtils.isEmpty(ssl.getCiphers())) {
		factory.setIncludeCipherSuites(ssl.getCiphers());
		factory.setExcludeCipherSuites();
	}
	if (ssl.getEnabledProtocols() != null) {
		factory.setIncludeProtocols(ssl.getEnabledProtocols());
	}
	if (getSslStoreProvider() != null) {
		try {
			factory.setKeyStore(getSslStoreProvider().getKeyStore());
			factory.setTrustStore(getSslStoreProvider().getTrustStore());
		}
		catch (Exception ex) {
			throw new IllegalStateException("Unable to set SSL store", ex);
		}
	}
	else {
		configureSslKeyStore(factory, ssl);
		configureSslTrustStore(factory, ssl);
	}
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:32,代码来源:JettyEmbeddedServletContainerFactory.java

示例4: createSSLContextObject

import org.eclipse.jetty.util.ssl.SslContextFactory; //导入方法依赖的package包/类
public static SslContextFactory createSSLContextObject(String[] clientProtocols, PrivateKeyStore privateKeyStore) {
    
    String keyStorePath = System.getProperty(ZTSConsts.ZTS_PROP_KEYSTORE_PATH);
    String keyStorePasswordAppName = System.getProperty(ZTSConsts.ZTS_PROP_KEYSTORE_PASSWORD_APPNAME);
    String keyStorePassword = System.getProperty(ZTSConsts.ZTS_PROP_KEYSTORE_PASSWORD);
    String keyStoreType = System.getProperty(ZTSConsts.ZTS_PROP_KEYSTORE_TYPE, "PKCS12");
    String keyManagerPassword = System.getProperty(ZTSConsts.ZTS_PROP_KEYMANAGER_PASSWORD);
    String keyManagerPasswordAppName = System.getProperty(ZTSConsts.ZTS_PROP_KEYMANAGER_PASSWORD_APPNAME);

    String trustStorePath = System.getProperty(ZTSConsts.ZTS_PROP_TRUSTSTORE_PATH);
    String trustStorePassword = System.getProperty(ZTSConsts.ZTS_PROP_TRUSTSTORE_PASSWORD);
    String trustStorePasswordAppName = System.getProperty(ZTSConsts.ZTS_PROP_TRUSTSTORE_PASSWORD_APPNAME);

    String trustStoreType = System.getProperty(ZTSConsts.ZTS_PROP_TRUSTSTORE_TYPE, "PKCS12");
    String excludedCipherSuites = System.getProperty(ZTSConsts.ZTS_PROP_EXCLUDED_CIPHER_SUITES,
            ZTS_DEFAULT_EXCLUDED_CIPHER_SUITES);
    String excludedProtocols = System.getProperty(ZTSConsts.ZTS_PROP_EXCLUDED_PROTOCOLS,
            ZTS_DEFAULT_EXCLUDED_PROTOCOLS);
    Boolean wantClientAuth = Boolean.parseBoolean(System.getProperty(ZTSConsts.ZTS_PROP_WANT_CLIENT_CERT, "false"));
    
    SslContextFactory sslContextFactory = new SslContextFactory();
    if (keyStorePath != null) {
        LOGGER.info("createSSLContextObject: using SSL KeyStore path: " + keyStorePath);
        sslContextFactory.setKeyStorePath(keyStorePath);
    }
    if (keyStorePassword != null) {
        if (null != privateKeyStore) {
            keyStorePassword = privateKeyStore.getApplicationSecret(keyStorePasswordAppName, keyStorePassword);
        }
        sslContextFactory.setKeyStorePassword(keyStorePassword);
    }
    sslContextFactory.setKeyStoreType(keyStoreType);

    if (keyManagerPassword != null) {
        if (null != privateKeyStore) {
            keyManagerPassword = privateKeyStore.getApplicationSecret(keyManagerPasswordAppName, keyManagerPassword);
        }
        sslContextFactory.setKeyManagerPassword(keyManagerPassword);
    }
    if (trustStorePath != null) {
        LOGGER.info("createSSLContextObject: using SSL TrustStore path: " + trustStorePath);
        sslContextFactory.setTrustStorePath(trustStorePath);
    }
    if (trustStorePassword != null) {
        if (null != privateKeyStore) {
            trustStorePassword = privateKeyStore.getApplicationSecret(trustStorePasswordAppName, trustStorePassword);
        }
        sslContextFactory.setTrustStorePassword(trustStorePassword);
    }
    sslContextFactory.setTrustStoreType(trustStoreType);

    if (excludedCipherSuites.length() != 0) {
        sslContextFactory.setExcludeCipherSuites(excludedCipherSuites.split(","));
    }
    
    if (excludedProtocols.length() != 0) {
        sslContextFactory.setExcludeProtocols(excludedProtocols.split(","));
    }

    sslContextFactory.setWantClientAuth(wantClientAuth);
    if (clientProtocols != null) {
        sslContextFactory.setIncludeProtocols(clientProtocols);
    }

    return sslContextFactory;
}
 
开发者ID:yahoo,项目名称:athenz,代码行数:67,代码来源:ZTSUtils.java


注:本文中的org.eclipse.jetty.util.ssl.SslContextFactory.setIncludeProtocols方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。