use of io.netty.handler.ssl.OpenSslServerSessionContext in project vert.x by eclipse.
the class SSLHelperTest method testOpenSslServerSessionContext.
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());
}
}
use of io.netty.handler.ssl.OpenSslServerSessionContext in project vert.x by eclipse.
the class SSLHelperTest method testOpenSslServerSessionContext.
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());
}
}
Aggregations