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


Java AbstractHttp11JsseProtocol类代码示例

本文整理汇总了Java中org.apache.coyote.http11.AbstractHttp11JsseProtocol的典型用法代码示例。如果您正苦于以下问题:Java AbstractHttp11JsseProtocol类的具体用法?Java AbstractHttp11JsseProtocol怎么用?Java AbstractHttp11JsseProtocol使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: configureSslTrustStore

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
private void configureSslTrustStore(AbstractHttp11JsseProtocol<?> protocol, Ssl ssl) {

		if (ssl.getTrustStore() != null) {
			try {
				protocol.setTruststoreFile(
						ResourceUtils.getURL(ssl.getTrustStore()).toString());
			}
			catch (FileNotFoundException ex) {
				throw new EmbeddedServletContainerException(
						"Could not load trust store: " + ex.getMessage(), ex);
			}
		}
		protocol.setTruststorePass(ssl.getTrustStorePassword());
		if (ssl.getTrustStoreType() != null) {
			protocol.setTruststoreType(ssl.getTrustStoreType());
		}
		if (ssl.getTrustStoreProvider() != null) {
			protocol.setTruststoreProvider(ssl.getTrustStoreProvider());
		}
	}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:21,代码来源:TomcatEmbeddedServletContainerFactory.java

示例2: configureSsl

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
/**
 * Configure Tomcat's {@link AbstractHttp11JsseProtocol} for SSL.
 * @param protocol the protocol
 * @param ssl the ssl details
 */
protected void configureSsl(AbstractHttp11JsseProtocol<?> protocol, Ssl ssl) {
	protocol.setSSLEnabled(true);
	protocol.setSslProtocol(ssl.getProtocol());
	configureSslClientAuth(protocol, ssl);
	protocol.setKeystorePass(ssl.getKeyStorePassword());
	protocol.setKeyPass(ssl.getKeyPassword());
	protocol.setKeyAlias(ssl.getKeyAlias());
	protocol.setCiphers(StringUtils.arrayToCommaDelimitedString(ssl.getCiphers()));
	if (ssl.getEnabledProtocols() != null) {
		protocol.setProperty("sslEnabledProtocols",
				StringUtils.arrayToCommaDelimitedString(ssl.getEnabledProtocols()));
	}
	if (getSslStoreProvider() != null) {
		configureSslStoreProvider(protocol, getSslStoreProvider());
	}
	else {
		configureSslKeyStore(protocol, ssl);
		configureSslTrustStore(protocol, ssl);
	}
}
 
开发者ID:philwebb,项目名称:spring-boot-concourse,代码行数:26,代码来源:TomcatEmbeddedServletContainerFactory.java

示例3: sslCiphersConfiguration

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
@Test
public void sslCiphersConfiguration() throws Exception {
	Ssl ssl = new Ssl();
	ssl.setKeyStore("test.jks");
	ssl.setKeyStorePassword("secret");
	ssl.setCiphers(new String[] { "ALPHA", "BRAVO", "CHARLIE" });

	TomcatEmbeddedServletContainerFactory factory = getFactory();
	factory.setSsl(ssl);

	Tomcat tomcat = getTomcat(factory);
	Connector connector = tomcat.getConnector();

	AbstractHttp11JsseProtocol<?> jsseProtocol = (AbstractHttp11JsseProtocol<?>) connector
			.getProtocolHandler();
	assertThat(jsseProtocol.getCiphers()).isEqualTo("ALPHA,BRAVO,CHARLIE");
}
 
开发者ID:philwebb,项目名称:spring-boot-concourse,代码行数:18,代码来源:TomcatEmbeddedServletContainerFactoryTests.java

示例4: sslEnabledMultipleProtocolsConfiguration

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
@Test
public void sslEnabledMultipleProtocolsConfiguration() throws Exception {
	Ssl ssl = new Ssl();
	ssl.setKeyStore("test.jks");
	ssl.setKeyStorePassword("secret");
	ssl.setEnabledProtocols(new String[] { "TLSv1.1", "TLSv1.2" });
	ssl.setCiphers(new String[] { "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", "BRAVO" });

	TomcatEmbeddedServletContainerFactory factory = getFactory();
	factory.setSsl(ssl);

	this.container = factory
			.getEmbeddedServletContainer(sessionServletRegistration());
	Tomcat tomcat = ((TomcatEmbeddedServletContainer) this.container).getTomcat();
	Connector connector = tomcat.getConnector();

	AbstractHttp11JsseProtocol<?> jsseProtocol = (AbstractHttp11JsseProtocol<?>) connector
			.getProtocolHandler();
	assertThat(jsseProtocol.getSslProtocol()).isEqualTo("TLS");
	assertThat(jsseProtocol.getProperty("sslEnabledProtocols"))
			.isEqualTo("TLSv1.1,TLSv1.2");
}
 
开发者ID:philwebb,项目名称:spring-boot-concourse,代码行数:23,代码来源:TomcatEmbeddedServletContainerFactoryTests.java

示例5: sslEnabledProtocolsConfiguration

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
@Test
public void sslEnabledProtocolsConfiguration() throws Exception {
	Ssl ssl = new Ssl();
	ssl.setKeyStore("test.jks");
	ssl.setKeyStorePassword("secret");
	ssl.setEnabledProtocols(new String[] { "TLSv1.2" });
	ssl.setCiphers(new String[] { "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", "BRAVO" });

	TomcatEmbeddedServletContainerFactory factory = getFactory();
	factory.setSsl(ssl);

	this.container = factory
			.getEmbeddedServletContainer(sessionServletRegistration());
	Tomcat tomcat = ((TomcatEmbeddedServletContainer) this.container).getTomcat();
	Connector connector = tomcat.getConnector();

	AbstractHttp11JsseProtocol<?> jsseProtocol = (AbstractHttp11JsseProtocol<?>) connector
			.getProtocolHandler();
	assertThat(jsseProtocol.getSslProtocol()).isEqualTo("TLS");
	assertThat(jsseProtocol.getProperty("sslEnabledProtocols")).isEqualTo("TLSv1.2");
}
 
开发者ID:philwebb,项目名称:spring-boot-concourse,代码行数:22,代码来源:TomcatEmbeddedServletContainerFactoryTests.java

示例6: configureSslTrustStore

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
private void configureSslTrustStore(AbstractHttp11JsseProtocol<?> protocol, Ssl ssl) {
	if (ssl.getTrustStore() != null) {
		try {
			protocol.setTruststoreFile(
					ResourceUtils.getURL(ssl.getTrustStore()).toString());
		}
		catch (FileNotFoundException ex) {
			throw new EmbeddedServletContainerException(
					"Could not load trust store: " + ex.getMessage(), ex);
		}
	}
	protocol.setTruststorePass(ssl.getTrustStorePassword());
	if (ssl.getTrustStoreType() != null) {
		protocol.setTruststoreType(ssl.getTrustStoreType());
	}
	if (ssl.getTrustStoreProvider() != null) {
		protocol.setTruststoreProvider(ssl.getTrustStoreProvider());
	}
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:20,代码来源:TomcatEmbeddedServletContainerFactory.java

示例7: sslCiphersConfiguration

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
@Test
public void sslCiphersConfiguration() throws Exception {
	Ssl ssl = new Ssl();
	ssl.setKeyStore("test.jks");
	ssl.setKeyStorePassword("secret");
	ssl.setCiphers(new String[] { "ALPHA", "BRAVO", "CHARLIE" });

	TomcatEmbeddedServletContainerFactory factory = getFactory();
	factory.setSsl(ssl);

	Tomcat tomcat = getTomcat(factory);
	Connector connector = tomcat.getConnector();

	AbstractHttp11JsseProtocol<?> jsseProtocol = (AbstractHttp11JsseProtocol<?>) connector
			.getProtocolHandler();
	assertThat(jsseProtocol.getCiphers(), equalTo("ALPHA,BRAVO,CHARLIE"));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:18,代码来源:TomcatEmbeddedServletContainerFactoryTests.java

示例8: build

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
public void build(AbstractHttp11JsseProtocol<?> protocol,SSLProperties sslProperties) {
    protocol.setKeystoreFile(sslProperties.getKeyStoreFile()); // contains server keypair
       protocol.setKeyPass(sslProperties.getKeyStorePass());
       sslProperties.getKeyStoreType().ifPresent(type->protocol.setKeystoreType(type));
       sslProperties.getKeyStoreProvider().ifPresent(provider->protocol.setKeystoreProvider(provider));
	
       sslProperties.getTrustStoreFile().ifPresent(file->protocol.setTruststoreFile(file)); // contains client certificate
       sslProperties.getTrustStorePass().ifPresent(pass->protocol.setTruststorePass(pass));
       
       sslProperties.getTrustStoreType().ifPresent(type->protocol.setTruststoreType(type));
       sslProperties.getTrustStoreProvider().ifPresent(provider->protocol.setTruststoreProvider(provider));
	sslProperties.getClientAuth().ifPresent(auth->protocol.setClientAuth(auth));
	
	protocol.setSSLEnabled(true);
	sslProperties.getCiphers().ifPresent(ciphers->protocol.setCiphers(ciphers));
	sslProperties.getProtocol().ifPresent(pr->protocol.setSslProtocol(pr));
      

}
 
开发者ID:aol,项目名称:micro-server,代码行数:20,代码来源:SSLConfigurationBuilder.java

示例9: getConnectorInfos

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
/**
 * Gets the connector infos.
 *
 * @param connectors the connectors
 * @return the connector infos
 * @throws IllegalAccessException the illegal access exception
 * @throws InvocationTargetException the invocation target exception
 */
private List<ConnectorInfo> getConnectorInfos(List<Connector> connectors)
    throws IllegalAccessException, InvocationTargetException {
  List<ConnectorInfo> infos = new ArrayList<>();
  for (Connector connector : connectors) {
    if (!connector.getSecure()) {
      continue;
    }

    ProtocolHandler protocolHandler = connector.getProtocolHandler();

    if (protocolHandler instanceof AbstractHttp11JsseProtocol) {
      AbstractHttp11JsseProtocol<?> protocol = (AbstractHttp11JsseProtocol<?>) protocolHandler;
      if (!protocol.getSecure()) {
        continue;
      }
      infos.add(toConnectorInfo(protocol));
    }
  }
  return infos;
}
 
开发者ID:psi-probe,项目名称:psi-probe,代码行数:29,代码来源:ListCertificatesController.java

示例10: customizeSsl

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
private void customizeSsl(Connector connector) {
	ProtocolHandler handler = connector.getProtocolHandler();
	Assert.state(handler instanceof AbstractHttp11JsseProtocol,
			"To use SSL, the connector's protocol handler must be an "
					+ "AbstractHttp11JsseProtocol subclass");
	configureSsl((AbstractHttp11JsseProtocol<?>) handler, getSsl());
	connector.setScheme("https");
	connector.setSecure(true);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:TomcatEmbeddedServletContainerFactory.java

示例11: configureSslClientAuth

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
private void configureSslClientAuth(AbstractHttp11JsseProtocol<?> protocol, Ssl ssl) {
	if (ssl.getClientAuth() == ClientAuth.NEED) {
		protocol.setClientAuth(Boolean.TRUE.toString());
	}
	else if (ssl.getClientAuth() == ClientAuth.WANT) {
		protocol.setClientAuth("want");
	}
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:TomcatEmbeddedServletContainerFactory.java

示例12: configureSslKeyStore

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
private void configureSslKeyStore(AbstractHttp11JsseProtocol<?> protocol, Ssl ssl) {
	try {
		protocol.setKeystoreFile(ResourceUtils.getURL(ssl.getKeyStore()).toString());
	}
	catch (FileNotFoundException ex) {
		throw new EmbeddedServletContainerException(
				"Could not load key store: " + ex.getMessage(), ex);
	}
	if (ssl.getKeyStoreType() != null) {
		protocol.setKeystoreType(ssl.getKeyStoreType());
	}
	if (ssl.getKeyStoreProvider() != null) {
		protocol.setKeystoreProvider(ssl.getKeyStoreProvider());
	}
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:16,代码来源:TomcatEmbeddedServletContainerFactory.java

示例13: configureSslStoreProvider

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
protected void configureSslStoreProvider(AbstractHttp11JsseProtocol<?> protocol,
		SslStoreProvider sslStoreProvider) {
	Assert.isInstanceOf(Http11NioProtocol.class, protocol,
			"SslStoreProvider can only be used with Http11NioProtocol");
	((Http11NioProtocol) protocol).getEndpoint().setAttribute("sslStoreProvider",
			sslStoreProvider);
	protocol.setSslImplementationName(
			TomcatEmbeddedJSSEImplementation.class.getName());
}
 
开发者ID:philwebb,项目名称:spring-boot-concourse,代码行数:10,代码来源:TomcatEmbeddedServletContainerFactory.java

示例14: configureSsl

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
/**
 * Configure Tomcat's {@link AbstractHttp11JsseProtocol} for SSL.
 * @param protocol the protocol
 * @param ssl the ssl details
 */
protected void configureSsl(AbstractHttp11JsseProtocol<?> protocol, Ssl ssl) {
	protocol.setSSLEnabled(true);
	protocol.setSslProtocol(ssl.getProtocol());
	configureSslClientAuth(protocol, ssl);
	protocol.setKeystorePass(ssl.getKeyStorePassword());
	protocol.setKeyPass(ssl.getKeyPassword());
	protocol.setKeyAlias(ssl.getKeyAlias());
	configureSslKeyStore(protocol, ssl);
	String ciphers = StringUtils.arrayToCommaDelimitedString(ssl.getCiphers());
	protocol.setCiphers(ciphers);
	configureSslTrustStore(protocol, ssl);
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:18,代码来源:TomcatEmbeddedServletContainerFactory.java

示例15: addSSL

import org.apache.coyote.http11.AbstractHttp11JsseProtocol; //导入依赖的package包/类
private void addSSL(Connector connector) {
	SSLProperties sslProperties = serverData.getRootContext().getBean(SSLProperties.class);
	ProtocolHandler handler = connector.getProtocolHandler();
	if(sslProperties!= null && handler instanceof AbstractHttp11JsseProtocol){
		new SSLConfigurationBuilder().build((AbstractHttp11JsseProtocol)handler,sslProperties);
		connector.setScheme("https");
		connector.setSecure(true);
	}
}
 
开发者ID:aol,项目名称:micro-server,代码行数:10,代码来源:TomcatApplication.java


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