AnsweredAssumed Answered

HiveServer2 JDBC SSL not working

Question asked by sathish on Sep 9, 2013
Latest reply on Sep 10, 2013 by vkorukanti
Can anyone give details on how to configure SSL for JDBC,
When trying to connect to hive server using the following url, `jdbc:hive2://<host>:10000/default;ssl=true;sslTrustStore=c:/keystore.truststore;sslTrustStorePassword=<password>`

My hiveserver2 is configured with SSL and I am always seeing the following error on the server side
Can anyone help how to setup selfsigned certificate and work with remote JDBC,
With the same certificate I am able to connect to beeline client, but don't know what is the reason for failure if I am connecting using JDBC.

    13/09/10 12:21:27 ERROR server.TThreadPoolServer: Error occurred during processing of message.
    java.lang.RuntimeException: org.apache.thrift.transport.TTransportException: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
            at org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:219)
            at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:189)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
            at java.lang.Thread.run(Thread.java:722)
    Caused by: org.apache.thrift.transport.TTransportException: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
            at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:129)
            at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
            at org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:178)
            at org.apache.thrift.transport.TSaslServerTransport.handleSaslStartMessage(TSaslServerTransport.java:125)
            at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:253)
            at org.apache.thrift.transport.TSaslServerTransport.open(TSaslServerTransport.java:41)
            at org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:216)
            ... 4 more
    Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
            at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:541)
            at sun.security.ssl.InputRecord.read(InputRecord.java:374)
            at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)
            at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1328)
            at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:882)
            at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
            at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
            at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
            at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
            at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:127)
            ... 10 more

Outcomes