use of io.vertx.core.net.OpenSSLEngineOptions in project vert.x by eclipse.
the class SSLEngineTest method testDefaultOpenSslOptionsJson.
@Test
public void testDefaultOpenSslOptionsJson() {
OpenSSLEngineOptions def = new OpenSSLEngineOptions();
OpenSSLEngineOptions json = new OpenSSLEngineOptions(def.toJson());
assertEquals(def.isSessionCacheEnabled(), json.isSessionCacheEnabled());
}
use of io.vertx.core.net.OpenSSLEngineOptions in project vert.x by eclipse.
the class NettyCompatTest method testHttp2.
@Test
public void testHttp2() {
vertx.createHttpServer(new HttpServerOptions().setUseAlpn(true).setSsl(true).setSslEngineOptions(new OpenSSLEngineOptions()).setKeyCertOptions(Cert.SERVER_JKS.get())).requestHandler(req -> req.response().end("OK")).listen(8443, "localhost", onSuccess(s -> {
HttpClient client = vertx.createHttpClient(new HttpClientOptions().setSsl(true).setSslEngineOptions(new OpenSSLEngineOptions()).setTrustStoreOptions(Trust.SERVER_JKS.get()));
client.getNow(8443, "localhost", "/somepath", resp -> {
resp.bodyHandler(buff -> {
assertEquals("OK", buff.toString());
testComplete();
});
});
}));
await();
}
use of io.vertx.core.net.OpenSSLEngineOptions in project vert.x by eclipse.
the class SSLEngineTest method testOpenSslOptions.
@Test
public void testOpenSslOptions() {
OpenSSLEngineOptions options = new OpenSSLEngineOptions();
assertEquals(true, options.isSessionCacheEnabled());
assertEquals(options, options.setSessionCacheEnabled(false));
assertEquals(false, options.isSessionCacheEnabled());
}
use of io.vertx.core.net.OpenSSLEngineOptions in project vert.x by eclipse.
the class SSLEngineTest method testCopyOpenSslOptions.
@Test
public void testCopyOpenSslOptions() {
OpenSSLEngineOptions options = new OpenSSLEngineOptions();
boolean sessionCacheEnabled = TestUtils.randomBoolean();
options.setSessionCacheEnabled(sessionCacheEnabled);
OpenSSLEngineOptions copy = new OpenSSLEngineOptions(options);
assertEquals(sessionCacheEnabled, copy.isSessionCacheEnabled());
}
use of io.vertx.core.net.OpenSSLEngineOptions in project vert.x by eclipse.
the class SSLEngineTest method testOpenSslOptionsJson.
@Test
public void testOpenSslOptionsJson() {
boolean sessionCacheEnabled = TestUtils.randomBoolean();
JsonObject json = new JsonObject();
json.put("sessionCacheEnabled", sessionCacheEnabled);
OpenSSLEngineOptions optins = new OpenSSLEngineOptions(json);
assertEquals(sessionCacheEnabled, optins.isSessionCacheEnabled());
}
Aggregations