/** * Sets the {@link SslContext} of this {@link VirtualHost}. * * @deprecated Use {@link #tls(SslContext)}. */ @Deprecated public B sslContext(SslContext sslContext) { return tls(sslContext); }
/** * Sets the {@link SslContext} of this {@link VirtualHost} from the specified {@link SessionProtocol}, * {@code keyCertChainFile}, {@code keyFile} and {@code keyPassword}. * * @deprecated Use {@link #tls(File, File, String)}. */ @Deprecated public B sslContext( SessionProtocol protocol, File keyCertChainFile, File keyFile, @Nullable String keyPassword) throws SSLException { if (requireNonNull(protocol, "protocol") != SessionProtocol.HTTPS) { throw new IllegalArgumentException("unsupported protocol: " + protocol); } return tls(keyCertChainFile, keyFile, keyPassword); }
/** * Configures SSL or TLS of this {@link VirtualHost} with the specified {@code keyCertChainFile} * and cleartext {@code keyFile}. */ public B tls(File keyCertChainFile, File keyFile) throws SSLException { tls(keyCertChainFile, keyFile, null); return self(); }
/** * Configures SSL or TLS of this {@link VirtualHost} with an auto-generated self-signed certificate. * <strong>Note:</strong> You should never use this in production but only for a testing purpose. * * @throws CertificateException if failed to generate a self-signed certificate */ public B tlsSelfSigned() throws SSLException, CertificateException { final SelfSignedCertificate ssc = new SelfSignedCertificate(defaultHostname); return tls(ssc.certificate(), ssc.privateKey()); }
tls(sslCtx); return self();