Search in sources :

Example 1 with TrustAndKeyProvider

use of com.codingchili.core.security.TrustAndKeyProvider in project chili-core by codingchili.

the class ListenerSettings method getHttpOptions.

/**
 * @param context core context.
 * @return HttpOptions created from the listeners settings.
 */
@JsonIgnore
public HttpServerOptions getHttpOptions(CoreContext context) {
    if (httpOptions == null) {
        httpOptions = new HttpServerOptions().setMaxWebsocketFrameSize(maxRequestBytes).setUseAlpn(Environment.isJava9()).setSsl(secure);
        if (secure) {
            TrustAndKeyProvider provider = security().getKeystore(context, keystore);
            httpOptions.setTrustOptions(provider.trustOptions()).setKeyCertOptions(provider.keyCertOptions());
        }
    }
    return httpOptions;
}
Also used : TrustAndKeyProvider(com.codingchili.core.security.TrustAndKeyProvider) HttpServerOptions(io.vertx.core.http.HttpServerOptions) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 2 with TrustAndKeyProvider

use of com.codingchili.core.security.TrustAndKeyProvider in project chili-core by codingchili.

the class SecuritySettingsTest method testLoadKeyStore.

@Test
public void testLoadKeyStore(TestContext test) {
    ContextMock mock = new ContextMock();
    try {
        getKeystoreBuilder().build();
        TrustAndKeyProvider provider = security().getKeystore(mock, IDENTIFIER);
        test.assertNotNull(provider);
    } finally {
        mock.close();
    }
}
Also used : TrustAndKeyProvider(com.codingchili.core.security.TrustAndKeyProvider) ContextMock(com.codingchili.core.testing.ContextMock) Test(org.junit.Test)

Example 3 with TrustAndKeyProvider

use of com.codingchili.core.security.TrustAndKeyProvider in project chili-core by codingchili.

the class ListenerSettings method getHttpOptions.

/**
 * @return HttpOptions created from the listeners settings.
 */
@JsonIgnore
public HttpServerOptions getHttpOptions() {
    if (httpOptions == null) {
        httpOptions = new HttpServerOptions().setMaxWebSocketFrameSize(maxRequestBytes).setUseAlpn(alpn).setCompressionSupported(true).setSsl(secure);
        if (secure) {
            TrustAndKeyProvider provider = security().getKeystore(keystore);
            httpOptions.setTrustOptions(provider.trustOptions()).setKeyCertOptions(provider.keyCertOptions());
        }
    }
    return httpOptions;
}
Also used : TrustAndKeyProvider(com.codingchili.core.security.TrustAndKeyProvider) HttpServerOptions(io.vertx.core.http.HttpServerOptions) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Aggregations

TrustAndKeyProvider (com.codingchili.core.security.TrustAndKeyProvider)3 JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)2 HttpServerOptions (io.vertx.core.http.HttpServerOptions)2 ContextMock (com.codingchili.core.testing.ContextMock)1 Test (org.junit.Test)1