Search in sources :

Example 1 with HttpsCertificate

use of com.github.dreamhead.moco.HttpsCertificate in project moco by dreamhead.

the class MocoHttpServer method toSslHandler.

private Function<HttpsCertificate, SslHandler> toSslHandler() {
    return new Function<HttpsCertificate, SslHandler>() {

        @Override
        public SslHandler apply(final HttpsCertificate certificate) {
            SSLEngine sslEngine = certificate.createSSLEngine();
            sslEngine.setUseClientMode(false);
            return new SslHandler(sslEngine);
        }
    };
}
Also used : Function(com.google.common.base.Function) HttpsCertificate(com.github.dreamhead.moco.HttpsCertificate) SSLEngine(javax.net.ssl.SSLEngine) SslHandler(io.netty.handler.ssl.SslHandler)

Aggregations

HttpsCertificate (com.github.dreamhead.moco.HttpsCertificate)1 Function (com.google.common.base.Function)1 SslHandler (io.netty.handler.ssl.SslHandler)1 SSLEngine (javax.net.ssl.SSLEngine)1