All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yahoo.jdisc.http.SslProvider Maven / Gradle / Ivy

// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.http;

import javax.net.ssl.SSLContext;
import java.security.KeyStore;
import java.util.List;

/**
 * Provides SSL/TLS configuration for a server connector.
 *
 * @author bjorncs
 */
public interface SslProvider extends AutoCloseable {

    interface ConnectorSsl {
        enum ClientAuth { DISABLED, WANT, NEED }
        ConnectorSsl setSslContext(SSLContext ctx);
        ConnectorSsl setClientAuth(ConnectorSsl.ClientAuth auth);
        ConnectorSsl setEnabledCipherSuites(List ciphers);
        ConnectorSsl setEnabledProtocolVersions(List versions);
        ConnectorSsl setKeystore(KeyStore keystore, char[] password);
        ConnectorSsl setKeystore(KeyStore keystore);
        ConnectorSsl setTruststore(KeyStore truststore, char[] password);
        ConnectorSsl setTruststore(KeyStore truststore);
    }

    /**
     * Invoked during configuration of server connector
     * @param ssl provides methods to modify default SSL configuration
     * @param name The connector name
     * @param port The connector listen port
     */
    void configureSsl(ConnectorSsl ssl, String name, int port);

    @Override default void close() {}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy