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


Java Http11NioProtocol.setTruststorePass方法代码示例

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


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

示例1: createSslConnector

import org.apache.coyote.http11.Http11NioProtocol; //导入方法依赖的package包/类
private Connector createSslConnector() {
    Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
    Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler();
    try {
        File keystore = new ClassPathResource(keystorePath).getFile();
        connector.setScheme(HTTPS_SCHEME);
        connector.setSecure(true);
        connector.setPort(Integer.parseInt(httpsPort));
        protocol.setSSLEnabled(true);
        protocol.setKeystoreFile(keystore.getAbsolutePath());
        protocol.setKeystorePass(keystorePasswd);
        protocol.setTruststoreFile(keystore.getAbsolutePath());
        protocol.setTruststorePass(truststorePasswd);
        protocol.setKeyAlias(keyAlias);
        return connector;
    } catch (IOException ex) {
        throw new IllegalStateException("cant access keystore: [" + "keystore"
                + "] or truststore: [" + "keystore" + "]", ex);
    }
}
 
开发者ID:sdl,项目名称:odata,代码行数:21,代码来源:TomcatConfiguration.java

示例2: createSslConnector

import org.apache.coyote.http11.Http11NioProtocol; //导入方法依赖的package包/类
private Connector createSslConnector() {
	Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
	Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler();
	try {
		File keystore = getKeyStoreFile();
		File truststore = keystore;
		connector.setScheme("https");
		connector.setSecure(true);
		connector.setPort(port());
		protocol.setSSLEnabled(true);
		protocol.setKeystoreFile(keystore.getAbsolutePath());
		protocol.setKeystorePass("changeit");
		protocol.setTruststoreFile(truststore.getAbsolutePath());
		protocol.setTruststorePass("changeit");
		protocol.setKeyAlias("apitester");
		return connector;
	}
	catch (IOException ex) {
		throw new IllegalStateException("cant access keystore: [" + "keystore"
				+ "] or truststore: [" + "keystore" + "]", ex);
	}
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:23,代码来源:SampleTomcatTwoConnectorsApplication.java

示例3: createSslConnector

import org.apache.coyote.http11.Http11NioProtocol; //导入方法依赖的package包/类
private Connector createSslConnector() {
	Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
	Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler();
	try {
		connector.setScheme("https");
		connector.setSecure(true);
		connector.setPort(tlsPort);

		File keystore = getKeyStoreFile();
		File truststore = keystore;

		protocol.setSSLEnabled(true);
		protocol.setKeystoreFile(keystore.getAbsolutePath());
		protocol.setKeystorePass(sslKeystorePassword);
		protocol.setTruststoreFile(truststore.getAbsolutePath());
		protocol.setTruststorePass(sslKeystorePassword);
		protocol.setKeyAlias(sslKeystoreAlias);
		return connector;
	} catch (IOException ex) {
		throw new IllegalStateException(
				"can't access keystore: [" + "keystore" + "] or truststore: [" + "keystore" + "]", ex);
	}
}
 
开发者ID:arnaldop,项目名称:enhanced-pet-clinic,代码行数:24,代码来源:TomcatConfig.java

示例4: createSslConnector

import org.apache.coyote.http11.Http11NioProtocol; //导入方法依赖的package包/类
private Connector createSslConnector() {
    Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
    Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler();
    File keystore = null;
    File truststore = null;
    try {
        keystore = new DefaultResourceLoader().getResource(this.pathToKeystore).getFile(); //new ClassPathResource(pathToKeystore).getFile();
        truststore = new DefaultResourceLoader().getResource(pathToKeystore).getFile();
        connector.setScheme("https");
        connector.setSecure(true);
        connector.setPort(443);
        protocol.setSSLEnabled(true);
        protocol.setKeystoreFile(keystore.getAbsolutePath());
        protocol.setKeystorePass(this.sslKeystorePwd);
        protocol.setTruststoreFile(truststore.getAbsolutePath());
        protocol.setTruststorePass(this.sslKeystorePwd);
        protocol.setKeyAlias(this.sslKeyAlias);
        return connector;
    }catch (IOException ex) {
        throw new IllegalStateException("can't access keystore: [" + keystore
                + "] or truststore: [" + truststore + "]", ex);
    }
}
 
开发者ID:datenstrudel,项目名称:bulbs-core,代码行数:24,代码来源:BulbsCoreApp.java


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