Search in sources :

Example 1 with OpenSSLEngineOptions

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());
}
Also used : OpenSSLEngineOptions(io.vertx.core.net.OpenSSLEngineOptions) Test(org.junit.Test)

Example 2 with OpenSSLEngineOptions

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();
}
Also used : OpenSSLEngineOptions(io.vertx.core.net.OpenSSLEngineOptions) VertxInternal(io.vertx.core.impl.VertxInternal) HttpServerOptions(io.vertx.core.http.HttpServerOptions) Test(org.junit.Test) HttpClientOptions(io.vertx.core.http.HttpClientOptions) Cert(io.vertx.test.core.tls.Cert) VertxTestBase(io.vertx.test.core.VertxTestBase) HttpClient(io.vertx.core.http.HttpClient) Trust(io.vertx.test.core.tls.Trust) HttpClient(io.vertx.core.http.HttpClient) HttpServerOptions(io.vertx.core.http.HttpServerOptions) OpenSSLEngineOptions(io.vertx.core.net.OpenSSLEngineOptions) HttpClientOptions(io.vertx.core.http.HttpClientOptions) Test(org.junit.Test)

Example 3 with OpenSSLEngineOptions

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());
}
Also used : OpenSSLEngineOptions(io.vertx.core.net.OpenSSLEngineOptions) Test(org.junit.Test)

Example 4 with OpenSSLEngineOptions

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());
}
Also used : OpenSSLEngineOptions(io.vertx.core.net.OpenSSLEngineOptions) Test(org.junit.Test)

Example 5 with OpenSSLEngineOptions

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());
}
Also used : JsonObject(io.vertx.core.json.JsonObject) OpenSSLEngineOptions(io.vertx.core.net.OpenSSLEngineOptions) Test(org.junit.Test)

Aggregations

OpenSSLEngineOptions (io.vertx.core.net.OpenSSLEngineOptions)8 Test (org.junit.Test)7 HttpClientOptions (io.vertx.core.http.HttpClientOptions)3 HttpServerOptions (io.vertx.core.http.HttpServerOptions)3 SslContext (io.netty.handler.ssl.SslContext)2 SSLHelper (io.vertx.core.net.impl.SSLHelper)2 Cert (io.vertx.test.core.tls.Cert)2 OpenSslServerContext (io.netty.handler.ssl.OpenSslServerContext)1 OpenSslServerSessionContext (io.netty.handler.ssl.OpenSslServerSessionContext)1 Context (io.vertx.core.Context)1 Buffer (io.vertx.core.buffer.Buffer)1 Http2Settings (io.vertx.core.http.Http2Settings)1 HttpClient (io.vertx.core.http.HttpClient)1 HttpClientRequest (io.vertx.core.http.HttpClientRequest)1 HttpServerResponse (io.vertx.core.http.HttpServerResponse)1 StreamResetException (io.vertx.core.http.StreamResetException)1 VertxInternal (io.vertx.core.impl.VertxInternal)1 JsonObject (io.vertx.core.json.JsonObject)1 NetServer (io.vertx.core.net.NetServer)1 PemKeyCertOptions (io.vertx.core.net.PemKeyCertOptions)1