Source:
private SslContext createContext(VertxInternal vertx, X509KeyManager mgr) { try { TrustManagerFactory trustMgrFactory = getTrustMgrFactory(vertx); SslContextBuilder builder; if (client) { builder = SslContextBuilder.forClient(); KeyManagerFactory keyMgrFactory = getKeyMgrFactory(vertx); if (keyMgrFactory != null) { builder.keyManager(keyMgrFactory); } } else { if (mgr != null) { builder = SslContextBuilder.forServer(mgr.getPrivateKey(null), "wibble", mgr.getCertificateChain(null)); } else { KeyManagerFactory keyMgrFactory = getKeyMgrFactory(vertx); if (keyMgrFactory == null) { throw new VertxException("Key/certificate is mandatory for SSL"); } builder = SslContextBuilder.forServer(keyMgrFactory); } } Collection<String> cipherSuites = enabledCipherSuites; if (openSsl) { builder.sslProvider(SslProvider.OPENSSL); if (cipherSuites == null || cipherSuites.isEmpty()) { cipherSuites = OpenSsl.availableOpenSslCipherSuites(); } } else { builder.sslProvider(SslProvider.JDK); if (cipherSuites == null || cipherSuites.isEmpty()) { cipherSuites = DEFAULT_JDK_CIPHER_SUITE; } } if (trustMgrFactory != null) { builder.trustManager(trustMgrFactory); } if (cipherSuites != null && cipherSuites.size() > 0) { builder.ciphers(cipherSuites); } if (useAlpn && applicationProtocols != null && applicationProtocols.size() > 0) { builder.applicationProtocolConfig(new ApplicationProtocolConfig( ApplicationProtocolConfig.Protocol.ALPN, ApplicationProtocolConfig.SelectorFailureBehavior.NO_ADVERTISE, ApplicationProtocolConfig.SelectedListenerFailureBehavior.ACCEPT, applicationProtocols.stream().map(PROTOCOL_NAME_MAPPING::get).collect(Collectors.toList()) )); } SslContext ctx = builder.build(); if (ctx instanceof OpenSslServerContext){ SSLSessionContext sslSessionContext = ctx.sessionContext(); if (sslSessionContext instanceof OpenSslServerSessionContext){ ((OpenSslServerSessionContext)sslSessionContext).setSessionCacheEnabled(openSslSessionCacheEnabled); } } return ctx; } catch (Exception e) { throw new VertxException(e); } }

Target:
private SslContext createContext(VertxInternal vertx, X509KeyManager mgr) { try { TrustManagerFactory trustMgrFactory = getTrustMgrFactory(vertx); SslContextBuilder builder; if (client) { builder = SslContextBuilder.forClient(); KeyManagerFactory keyMgrFactory = getKeyMgrFactory(vertx); if (keyMgrFactory != null) { builder.keyManager(keyMgrFactory); } } else { if (mgr != null) { builder = SslContextBuilder.forServer(mgr.getPrivateKey(null), null, mgr.getCertificateChain(null)); } else { KeyManagerFactory keyMgrFactory = getKeyMgrFactory(vertx); if (keyMgrFactory == null) { throw new VertxException("Key/certificate is mandatory for SSL"); } builder = SslContextBuilder.forServer(keyMgrFactory); } } Collection<String> cipherSuites = enabledCipherSuites; if (openSsl) { builder.sslProvider(SslProvider.OPENSSL); if (cipherSuites == null || cipherSuites.isEmpty()) { cipherSuites = OpenSsl.availableOpenSslCipherSuites(); } } else { builder.sslProvider(SslProvider.JDK); if (cipherSuites == null || cipherSuites.isEmpty()) { cipherSuites = DEFAULT_JDK_CIPHER_SUITE; } } if (trustMgrFactory != null) { builder.trustManager(trustMgrFactory); } if (cipherSuites != null && cipherSuites.size() > 0) { builder.ciphers(cipherSuites); } if (useAlpn && applicationProtocols != null && applicationProtocols.size() > 0) { builder.applicationProtocolConfig(new ApplicationProtocolConfig( ApplicationProtocolConfig.Protocol.ALPN, ApplicationProtocolConfig.SelectorFailureBehavior.NO_ADVERTISE, ApplicationProtocolConfig.SelectedListenerFailureBehavior.ACCEPT, applicationProtocols.stream().map(PROTOCOL_NAME_MAPPING::get).collect(Collectors.toList()) )); } SslContext ctx = builder.build(); if (ctx instanceof OpenSslServerContext){ SSLSessionContext sslSessionContext = ctx.sessionContext(); if (sslSessionContext instanceof OpenSslServerSessionContext){ ((OpenSslServerSessionContext)sslSessionContext).setSessionCacheEnabled(openSslSessionCacheEnabled); } } return ctx; } catch (Exception e) { throw new VertxException(e); } }