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

com.yahoo.vespa.zookeeper.client.VespaSslContextProvider Maven / Gradle / Ivy

There is a newer version: 8.458.13
Show newest version
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.zookeeper.client;

import com.yahoo.vespa.zookeeper.tls.VespaZookeeperTlsContextUtils;

import javax.net.ssl.SSLContext;
import java.util.function.Supplier;

/**
 * Provider for Vespa {@link SSLContext} instance to Zookeeper.
 *
 * @author bjorncs
 */
public class VespaSslContextProvider implements Supplier {

    @Override
    public SSLContext get() {
        return VespaZookeeperTlsContextUtils.tlsContext()
                                            .orElseThrow(() -> new IllegalStateException("Vespa TLS is not enabled"))
                                            .sslContext().context();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy