Search in sources :

Example 71 with SSLParameters

use of javax.net.ssl.SSLParameters in project hive by apache.

the class SecurityUtils method getSSLSocketWithHttps.

// Using endpoint identification algorithm as HTTPS enables us to do
// CNAMEs/subjectAltName verification
private static TSocket getSSLSocketWithHttps(TSocket tSSLSocket) throws TTransportException {
    SSLSocket sslSocket = (SSLSocket) tSSLSocket.getSocket();
    SSLParameters sslParams = sslSocket.getSSLParameters();
    sslParams.setEndpointIdentificationAlgorithm("HTTPS");
    sslSocket.setSSLParameters(sslParams);
    return new TSocket(sslSocket);
}
Also used : SSLParameters(javax.net.ssl.SSLParameters) SSLSocket(javax.net.ssl.SSLSocket) TSocket(org.apache.thrift.transport.TSocket)

Aggregations

SSLParameters (javax.net.ssl.SSLParameters)71 SSLSocket (javax.net.ssl.SSLSocket)16 Test (org.testng.annotations.Test)16 SSLSocketFactory (javax.net.ssl.SSLSocketFactory)14 SSLContext (javax.net.ssl.SSLContext)13 SSLEngine (javax.net.ssl.SSLEngine)10 Test (org.junit.Test)10 ByteString (com.linkedin.data.ByteString)9 AsciiString (io.netty.util.AsciiString)9 InetSocketAddress (java.net.InetSocketAddress)6 SNIHostName (javax.net.ssl.SNIHostName)6 ArrayList (java.util.ArrayList)5 SslContextFactory (org.eclipse.jetty.util.ssl.SslContextFactory)5 IOException (java.io.IOException)4 URI (java.net.URI)4 X509Certificate (java.security.cert.X509Certificate)4 Jedis (redis.clients.jedis.Jedis)4 JedisShardInfo (redis.clients.jedis.JedisShardInfo)4 FutureCallback (com.linkedin.common.callback.FutureCallback)3 HttpsConfigurator (com.sun.net.httpserver.HttpsConfigurator)3