本文整理汇总了Java中org.apache.tomcat.util.net.SSLHostConfigCertificate类的典型用法代码示例。如果您正苦于以下问题:Java SSLHostConfigCertificate类的具体用法?Java SSLHostConfigCertificate怎么用?Java SSLHostConfigCertificate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SSLHostConfigCertificate类属于org.apache.tomcat.util.net包,在下文中一共展示了SSLHostConfigCertificate类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: makeConnector
import org.apache.tomcat.util.net.SSLHostConfigCertificate; //导入依赖的package包/类
private Connector makeConnector() {
Connector connector = new Connector(Http11Nio2Protocol.class.getName());
if (keystoreFile == null) {
// HTTP connector
connector.setPort(port);
connector.setSecure(false);
connector.setScheme("http");
} else {
// HTTPS connector
connector.setPort(securePort);
connector.setSecure(true);
connector.setScheme("https");
connector.setAttribute("SSLEnabled", "true");
SSLHostConfig sslHostConfig = new SSLHostConfig();
SSLHostConfigCertificate cert =
new SSLHostConfigCertificate(sslHostConfig, SSLHostConfigCertificate.Type.RSA);
cert.setCertificateKeystoreFile(keystoreFile.toAbsolutePath().toString());
cert.setCertificateKeystorePassword(keystorePassword);
cert.setCertificateKeyAlias(keyAlias);
sslHostConfig.addCertificate(cert);
connector.addSslHostConfig(sslHostConfig);
}
connector.addUpgradeProtocol(new Http2Protocol());
// Keep quiet about the server type
connector.setXpoweredBy(false);
// Basic tuning params:
connector.setAttribute("maxThreads", 400);
connector.setAttribute("acceptCount", 50);
//connector.setAttribute("connectionTimeout", 2000);
connector.setAttribute("maxKeepAliveRequests", 100);
// Avoid running out of ephemeral ports under heavy load?
connector.setAttribute("socket.soReuseAddress", true);
connector.setMaxPostSize(0);
connector.setAttribute("disableUploadTimeout", false);
// Allow long URLs
connector.setAttribute("maxHttpHeaderSize", 65536);
// Enable response compression
connector.setAttribute("compression", "on");
// Defaults are text/html,text/xml,text/plain,text/css
connector.setAttribute("compressableMimeType", "text/html,text/xml,text/plain,text/css,text/csv,application/json");
return connector;
}
开发者ID:oncewang,项目名称:oryx2,代码行数:55,代码来源:ServingLayer.java
示例2: toSslHostConfigInfo
import org.apache.tomcat.util.net.SSLHostConfigCertificate; //导入依赖的package包/类
/**
* To SslHostConfig info.
*
* @param sslHostConfig the SslHostConfig
* @return the SslHostConfig info
* @throws IllegalAccessException the illegal access exception
* @throws InvocationTargetException the invocation target exception
*/
private SslHostConfigInfo toSslHostConfigInfo(SSLHostConfig sslHostConfig)
throws IllegalAccessException, InvocationTargetException {
SslHostConfigInfo sslHostConfigInfo = new SslHostConfigInfo();
BeanUtils.copyProperties(sslHostConfigInfo, sslHostConfig);
Set<SSLHostConfigCertificate> certificates = sslHostConfig.getCertificates();
List<CertificateInfo> certificateInfos = new ArrayList<>(certificates.size());
sslHostConfigInfo.setCertificateInfos(certificateInfos);
for (SSLHostConfigCertificate sslHostConfigCertificate : certificates) {
certificateInfos.add(toCertificateInfo(sslHostConfigCertificate));
}
return sslHostConfigInfo;
}
开发者ID:psi-probe,项目名称:psi-probe,代码行数:23,代码来源:SslHostConfigHelper.java
示例3: BlacklistingJSSESocketFactory
import org.apache.tomcat.util.net.SSLHostConfigCertificate; //导入依赖的package包/类
public BlacklistingJSSESocketFactory(SSLHostConfigCertificate certificate) {
super(certificate);
String blacklistFile = Optional.ofNullable(certificate.getSSLHostConfig().getCertificateRevocationListFile())
.filter(file -> file.startsWith(BLACKLIST_PREFIX))
.map(file -> file.substring(BLACKLIST_PREFIX.length()))
.orElse(null);
if (blacklistFile != null) {
certificate.getSSLHostConfig().setCertificateRevocationListFile(null);
blacklist = Blacklist.forFile(blacklistFile);
} else {
blacklist = null;
}
}
开发者ID:spinnaker,项目名称:kork,代码行数:15,代码来源:BlacklistingJSSESocketFactory.java
示例4: decodePasswords
import org.apache.tomcat.util.net.SSLHostConfigCertificate; //导入依赖的package包/类
static SSLHostConfigCertificate decodePasswords(SSLHostConfigCertificate certificate) {
String certificateKeystorePassword = certificate.getCertificateKeystorePassword();
if (certificateKeystorePassword != null) {
certificate.setCertificateKeystorePassword(Encryption.decode(certificateKeystorePassword));
}
String certificateKeyPassword = certificate.getCertificateKeyPassword();
if (certificateKeyPassword != null) {
certificate.setCertificateKeyPassword(Encryption.decode(certificateKeyPassword));
}
return certificate;
}
开发者ID:Sewatech,项目名称:swutils,代码行数:14,代码来源:EncryptedPasswordUtil.java
示例5: keystorePass_should_be_decoded
import org.apache.tomcat.util.net.SSLHostConfigCertificate; //导入依赖的package包/类
@Test
public void keystorePass_should_be_decoded() throws Exception {
// GIVeN
// WHeN
protocol.setKeystorePass(ENCRYPTED_PASSWORD);
// THeN
SSLHostConfigCertificate certificate = getSslHostConfigCertificate(protocol);
assertThat(certificate.getCertificateKeystorePassword()).isEqualTo(CLEAR_PASSWORD);
}
开发者ID:Sewatech,项目名称:swutils,代码行数:13,代码来源:EncryptedSslHttp11NioProtocolTest.java
示例6: keyPass_should_be_decoded
import org.apache.tomcat.util.net.SSLHostConfigCertificate; //导入依赖的package包/类
@Test
public void keyPass_should_be_decoded() throws Exception {
// GIVeN
// WHeN
protocol.setKeyPass(ENCRYPTED_PASSWORD);
// THeN
SSLHostConfigCertificate certificate = getSslHostConfigCertificate(protocol);
assertThat(certificate.getCertificateKeyPassword()).isEqualTo(CLEAR_PASSWORD);
}
开发者ID:Sewatech,项目名称:swutils,代码行数:13,代码来源:EncryptedSslHttp11NioProtocolTest.java
示例7: getSSLUtil
import org.apache.tomcat.util.net.SSLHostConfigCertificate; //导入依赖的package包/类
@Override
public SSLUtil getSSLUtil(SSLHostConfigCertificate cert) {
return new JSSUtil();
}
开发者ID:dogtagpki,项目名称:tomcatjss,代码行数:5,代码来源:JSSImplementation.java
示例8: getSSLUtil
import org.apache.tomcat.util.net.SSLHostConfigCertificate; //导入依赖的package包/类
@Override
public SSLUtil getSSLUtil(SSLHostConfigCertificate certificate) {
return new BlacklistingJSSESocketFactory(certificate);
}
开发者ID:spinnaker,项目名称:kork,代码行数:5,代码来源:BlacklistingSSLImplementation.java
示例9: getSSLUtil
import org.apache.tomcat.util.net.SSLHostConfigCertificate; //导入依赖的package包/类
@Override
public SSLUtil getSSLUtil(SSLHostConfigCertificate certificate) {
return super.getSSLUtil(decodePasswords(certificate));
}
开发者ID:Sewatech,项目名称:swutils,代码行数:5,代码来源:JSSEEncryptedPasswordImplementation.java
示例10: getSslHostConfigCertificate
import org.apache.tomcat.util.net.SSLHostConfigCertificate; //导入依赖的package包/类
private SSLHostConfigCertificate getSslHostConfigCertificate(EncryptedSslHttp11NioProtocol protocol) {
return getSslHostConfig(protocol).getCertificates().iterator().next();
}
开发者ID:Sewatech,项目名称:swutils,代码行数:4,代码来源:EncryptedSslHttp11NioProtocolTest.java
示例11: getSslHostConfigCertificate
import org.apache.tomcat.util.net.SSLHostConfigCertificate; //导入依赖的package包/类
private SSLHostConfigCertificate getSslHostConfigCertificate(EncryptedSslHttp11Nio2Protocol protocol) {
return getSslHostConfig(protocol).getCertificates().iterator().next();
}
开发者ID:Sewatech,项目名称:swutils,代码行数:4,代码来源:EncryptedSslHttp11Nio2ProtocolTest.java
示例12: toCertificateInfo
import org.apache.tomcat.util.net.SSLHostConfigCertificate; //导入依赖的package包/类
/**
* To certificate info.
*
* @param sslHostConfigCertificate the SslHostConfigCertificate
* @return the certificate info
* @throws IllegalAccessException the illegal access exception
* @throws InvocationTargetException the invocation target exception
*/
private CertificateInfo toCertificateInfo(SSLHostConfigCertificate sslHostConfigCertificate)
throws IllegalAccessException, InvocationTargetException {
CertificateInfo certificateInfo = new CertificateInfo();
BeanUtils.copyProperties(certificateInfo, sslHostConfigCertificate);
return certificateInfo;
}
开发者ID:psi-probe,项目名称:psi-probe,代码行数:15,代码来源:SslHostConfigHelper.java
注:本文中的org.apache.tomcat.util.net.SSLHostConfigCertificate类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论