Example usage for javax.net.ssl SSLEngine getSupportedProtocols

List of usage examples for javax.net.ssl SSLEngine getSupportedProtocols

Introduction

In this page you can find the example usage for javax.net.ssl SSLEngine getSupportedProtocols.

Prototype

public abstract String[] getSupportedProtocols();

Source Link

Document

Returns the names of the protocols which could be enabled for use with this SSLEngine .

Usage

From source file:com.eucalyptus.crypto.util.SslSetup.java

public static SSLEngine getServerEngine() {//TODO:GRZE: @Configurability
    final SSLEngine engine = SERVER_CONTEXT.createSSLEngine();
    engine.setUseClientMode(false);//  w  w  w  . j av  a 2s .  c o m
    engine.setWantClientAuth(false);
    engine.setNeedClientAuth(false);
    engine.setEnabledProtocols(
            SslUtils.getEnabledProtocols(SERVER_SSL_PROTOCOLS, engine.getSupportedProtocols()));
    engine.setEnabledCipherSuites(
            SslUtils.getEnabledCipherSuites(SERVER_SSL_CIPHERS, SERVER_SUPPORTED_CIPHERS));
    return engine;
}

From source file:com.hypersocket.server.HypersocketServerImpl.java

@Override
public String[] getSSLProtocols() {
    SSLEngine engine = defaultSSLContext.createSSLEngine();
    return engine.getSupportedProtocols();
}

From source file:org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduit.java

public void initializeSSLEngine(SSLContext sslcontext, SSLEngine sslengine) {
    TLSClientParameters tlsClientParameters = getTlsClientParameters();
    if (tlsClientParameters == null) {
        tlsClientParameters = new TLSClientParameters();
    }/*  w w  w .  j a  v a2 s .c om*/

    String[] cipherSuites = SSLUtils.getCiphersuitesToInclude(tlsClientParameters.getCipherSuites(),
            tlsClientParameters.getCipherSuitesFilter(), sslcontext.getSocketFactory().getDefaultCipherSuites(),
            SSLUtils.getSupportedCipherSuites(sslcontext), LOG);
    sslengine.setEnabledCipherSuites(cipherSuites);

    String protocol = tlsClientParameters.getSecureSocketProtocol() != null
            ? tlsClientParameters.getSecureSocketProtocol()
            : "TLS";

    String p[] = findProtocols(protocol, sslengine.getSupportedProtocols());
    if (p != null) {
        sslengine.setEnabledProtocols(p);
    }
}