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;
}
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();
}
}
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;
}
Aggregations