本文整理匯總了Java中org.eclipse.jetty.util.ssl.SslContextFactory.setCipherComparator方法的典型用法代碼示例。如果您正苦於以下問題:Java SslContextFactory.setCipherComparator方法的具體用法?Java SslContextFactory.setCipherComparator怎麽用?Java SslContextFactory.setCipherComparator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jetty.util.ssl.SslContextFactory
的用法示例。
在下文中一共展示了SslContextFactory.setCipherComparator方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: customize
import org.eclipse.jetty.util.ssl.SslContextFactory; //導入方法依賴的package包/類
@Override
public void customize(Server server) {
// HTTPS Configuration
HttpConfiguration httpsConfig = new HttpConfiguration();
httpsConfig.setSecureScheme("https");
httpsConfig.setSecurePort(8443);
httpsConfig.addCustomizer(new SecureRequestCustomizer());
// SSL Context Factory for HTTPS and HTTP/2
SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setKeyStoreResource(newClassPathResource("keystore"));
sslContextFactory.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
sslContextFactory.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g");
sslContextFactory.setCipherComparator(HTTP2Cipher.COMPARATOR);
// SSL Connection Factory
SslConnectionFactory ssl = new SslConnectionFactory(sslContextFactory, "h2");
// HTTP/2 Connector
ServerConnector http2Connector = new ServerConnector(server, ssl, new HTTP2ServerConnectionFactory(httpsConfig));
http2Connector.setPort(8443);
server.addConnector(http2Connector);
}
示例2: getSslContextFactory
import org.eclipse.jetty.util.ssl.SslContextFactory; //導入方法依賴的package包/類
/**
* Create a SslContextFactory with a http2-ready cipher comparator.
* @return
*/
@Bean
public static SslContextFactory getSslContextFactory() {
SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setCipherComparator(HTTP2Cipher.COMPARATOR);
sslContextFactory.setUseCipherSuitesOrder(true);
return sslContextFactory;
}
示例3: prepareSsl
import org.eclipse.jetty.util.ssl.SslContextFactory; //導入方法依賴的package包/類
private SslConnectionFactory prepareSsl(ALPNServerConnectionFactory alpn) {
SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setKeyStorePath(
Application.class.getResource("/keystore").toExternalForm());
sslContextFactory.setKeyStorePassword("changeit");
sslContextFactory.setCipherComparator(HTTP2Cipher.COMPARATOR);
sslContextFactory.setUseCipherSuitesOrder(true);
SslConnectionFactory ssl = new SslConnectionFactory(sslContextFactory,
alpn.getProtocol());
return ssl;
}
示例4: configureServerForHttp2
import org.eclipse.jetty.util.ssl.SslContextFactory; //導入方法依賴的package包/類
/**
* Configure the http2 server.
*
* @param server the server
* @return the server
*/
@VisibleForTesting
Server configureServerForHttp2(Server server) {
// HTTP Configuration
HttpConfiguration http11Config = new HttpConfiguration();
http11Config.setSecureScheme("https");
http11Config.setSecurePort(httpsPort);
// SSL Context Factory for HTTPS and HTTP/2
SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setKeyStoreResource(newClassPathResource("sample.jks"));
sslContextFactory.setKeyStorePassword("secret");
sslContextFactory.setKeyManagerPassword("secret");
sslContextFactory.setCipherComparator(HTTP2Cipher.COMPARATOR);
sslContextFactory.setUseCipherSuitesOrder(true);
// HTTPS Configuration
HttpConfiguration httpsConfig = new HttpConfiguration(http11Config);
httpsConfig.addCustomizer(new SecureRequestCustomizer());
// HTTP/2 Connection Factory
HTTP2ServerConnectionFactory h2 = new HTTP2ServerConnectionFactory(httpsConfig);
NegotiatingServerConnectionFactory.checkProtocolNegotiationAvailable();
ALPNServerConnectionFactory alpnServerConnectionFactory = new ALPNServerConnectionFactory();
alpnServerConnectionFactory.setDefaultProtocol("h2");
alpnServerConnectionFactory.getALPNProcessor();
// SSL Connection Factory
SslConnectionFactory sslConnectionFactory =
new SslConnectionFactory(sslContextFactory,
alpnServerConnectionFactory.getProtocol());
// HTTP/2 Connector
ServerConnector http2Connector =
new ServerConnector(server, sslConnectionFactory, alpnServerConnectionFactory, h2,
new HttpConnectionFactory(httpsConfig));
http2Connector.setPort(httpPort);
server.addConnector(http2Connector);
return server;
}
示例5: configureSslContextFactoryFrom
import org.eclipse.jetty.util.ssl.SslContextFactory; //導入方法依賴的package包/類
private SslContextFactory configureSslContextFactoryFrom(final ServerConnector connector) {
final SslContextFactory sslContextFactory = getSslContextFactoryFrom(connector);
sslContextFactory.setCipherComparator(HTTP2Cipher.COMPARATOR);
sslContextFactory.setUseCipherSuitesOrder(true);
return sslContextFactory;
}