本文整理了Java中io.netty.handler.ssl.SslContext.sessionContext()
方法的一些代码示例,展示了SslContext.sessionContext()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SslContext.sessionContext()
方法的具体详情如下:
包路径:io.netty.handler.ssl.SslContext
类名称:SslContext
方法名:sessionContext
[英]Returns the SSLSessionContext object held by this context.
[中]返回此上下文持有的SSLSessionContext对象。
代码示例来源:origin: redisson/redisson
@Override
public final SSLSessionContext sessionContext() {
return ctx.sessionContext();
}
代码示例来源:origin: wildfly/wildfly
@Override
public final SSLSessionContext sessionContext() {
return ctx.sessionContext();
}
代码示例来源:origin: eclipse-vertx/vert.x
SSLSessionContext sslSessionContext = ctx.sessionContext();
if (sslSessionContext instanceof OpenSslServerSessionContext){
((OpenSslServerSessionContext)sslSessionContext).setSessionCacheEnabled(openSslSessionCacheEnabled);
代码示例来源:origin: io.netty/netty-handler
@Override
public final SSLSessionContext sessionContext() {
return ctx.sessionContext();
}
代码示例来源:origin: eclipse-vertx/vert.x
private void testOpenSslServerSessionContext(boolean testDefault){
HttpServerOptions httpServerOptions = new HttpServerOptions().setOpenSslEngineOptions(new OpenSSLEngineOptions());
if(!testDefault) {
httpServerOptions.setOpenSslEngineOptions(new OpenSSLEngineOptions().setSessionCacheEnabled(false));
}
SSLHelper defaultHelper = new SSLHelper(httpServerOptions,
Cert.SERVER_PEM.get(),
Trust.SERVER_PEM.get());
SslContext ctx = defaultHelper.getContext((VertxInternal) vertx);
assertTrue(ctx instanceof OpenSslServerContext);
SSLSessionContext sslSessionContext = ctx.sessionContext();
assertTrue(sslSessionContext instanceof OpenSslServerSessionContext);
if (sslSessionContext instanceof OpenSslServerSessionContext) {
assertEquals(testDefault, ((OpenSslServerSessionContext) sslSessionContext).isSessionCacheEnabled());
}
}
代码示例来源:origin: io.vertx/vertx-core
SSLSessionContext sslSessionContext = ctx.sessionContext();
if (sslSessionContext instanceof OpenSslServerSessionContext){
((OpenSslServerSessionContext)sslSessionContext).setSessionCacheEnabled(openSslSessionCacheEnabled);
代码示例来源:origin: apache/activemq-artemis
@Override
public final SSLSessionContext sessionContext() {
return ctx.sessionContext();
}
代码示例来源:origin: org.apache.activemq/artemis-jms-client-all
@Override
public final SSLSessionContext sessionContext() {
return ctx.sessionContext();
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
@Override
public final SSLSessionContext sessionContext() {
return ctx.sessionContext();
}
代码示例来源:origin: io.vertx/vertx-core
private void testOpenSslServerSessionContext(boolean testDefault){
HttpServerOptions httpServerOptions = new HttpServerOptions().setOpenSslEngineOptions(new OpenSSLEngineOptions());
if(!testDefault) {
httpServerOptions.setOpenSslEngineOptions(new OpenSSLEngineOptions().setSessionCacheEnabled(false));
}
SSLHelper defaultHelper = new SSLHelper(httpServerOptions,
Cert.SERVER_PEM.get(),
Trust.SERVER_PEM.get());
SslContext ctx = defaultHelper.getContext((VertxInternal) vertx);
assertTrue(ctx instanceof OpenSslServerContext);
SSLSessionContext sslSessionContext = ctx.sessionContext();
assertTrue(sslSessionContext instanceof OpenSslServerSessionContext);
if (sslSessionContext instanceof OpenSslServerSessionContext) {
assertEquals(testDefault, ((OpenSslServerSessionContext) sslSessionContext).isSessionCacheEnabled());
}
}
代码示例来源:origin: io.netty/netty-testsuite
SSLSessionContext clientSessionCtx = clientCtx.sessionContext();
ByteBuf msg = Unpooled.wrappedBuffer(new byte[] { 0xa, 0xb, 0xc, 0xd }, 0, 4);
Channel cc = cb.connect(sc.localAddress()).sync().channel();
代码示例来源:origin: HotelsDotCom/styx
private static void registerOpenSslStats(SslContext sslContext, MetricRegistry metricRegistry) {
SSLSessionContext sslSessionContext = sslContext.sessionContext();
if (sslSessionContext instanceof OpenSslSessionContext) {
OpenSslSessionStats stats = ((OpenSslSessionContext) sslSessionContext).stats();
MetricRegistry sessionStatsRegistry = metricRegistry.scope("connections.openssl.session");
sessionStatsRegistry.register("number", (Gauge<Long>) stats::number);
sessionStatsRegistry.register("accept", (Gauge<Long>) stats::accept);
sessionStatsRegistry.register("acceptGood", (Gauge<Long>) stats::acceptGood);
sessionStatsRegistry.register("acceptRenegotiate", (Gauge<Long>) stats::acceptRenegotiate);
sessionStatsRegistry.register("hits", (Gauge<Long>) stats::hits);
sessionStatsRegistry.register("misses", (Gauge<Long>) stats::misses);
sessionStatsRegistry.register("cbHits", (Gauge<Long>) stats::cbHits);
sessionStatsRegistry.register("cacheFull", (Gauge<Long>) stats::cacheFull);
sessionStatsRegistry.register("timeouts", (Gauge<Long>) stats::timeouts);
}
}
内容来源于网络,如有侵权,请联系作者删除!