cloudera 5.9上的SSL握手问题

时间:2017-12-14 18:59:27

标签: java ssl https salesforce cloudera

我正在尝试在cloudera集群5.9中使用salesforce wave api库(https://github.com/springml/salesforce-wave-api)来获取数据,我必须使用代理,因为从我们的集群中它是与外界通信的唯一方式。 所以我对库进行了更改以使代理主机和端口在下面进行通信,这是我进行更改的地方。

改变1: -

config.setProxy("myenterpiseproxy server",port);

https://github.com/springml/salesforce-wave-api/blob/0ac76aeb2221d9e7038229fd352a8694e8cde7e9/src/main/java/com/springml/salesforce/wave/util/SFConfig.java#L101

改变2: -

HttpHost proxy = new HttpHost("myenterpiseproxy server", port, "http");

https://github.com/springml/salesforce-wave-api/blob/0ac76aeb2221d9e7038229fd352a8694e8cde7e9/src/main/java/com/springml/salesforce/wave/util/HTTPHelper.java#L127

改变3: -

RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(timeout)
            .setConnectTimeout(timeout).setConnectionRequestTimeout(timeout).setProxy(proxy).build();

https://github.com/springml/salesforce-wave-api/blob/0ac76aeb2221d9e7038229fd352a8694e8cde7e9/src/main/java/com/springml/salesforce/wave/util/HTTPHelper.java#L129

我构建了一个使用salesforce wave api作为依赖项的应用程序,我试图执行Jar我收到SSL握手问题。

我传入了javax.net.ssl.truststore,javax.net.ssl.keyStore,我的群集的https.protocols仍有问题。

有没有人有过类似的问题?有没有人试图在cloudera集群中使用这个库?

Run Book: -

java -cp httpclient-4.5.jar:SFWaveApiTest-1.0-SNAPSHOT-jar-with-dependencies.jar com.az.sfget.SFGetTest "username" "passwordwithtoken" "https://test.salesforce.com/services/Soap/u/35" "select id,OWNERID from someobject" "enterpiseproxyhost" "9400" "TLSv1.1,TLSv1.2" "/usr/java/jdk1.7.0_67-cloudera/jre/lib/security/jssecacerts" "/opt/cloudera/security/jks/uscvlpcldra-keystore.jks"

错误: -

javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:946)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:388)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
    at com.springml.salesforce.wave.util.HTTPHelper.execute(HTTPHelper.java:122)
    at com.springml.salesforce.wave.util.HTTPHelper.get(HTTPHelper.java:88)
    at com.springml.salesforce.wave.util.HTTPHelper.get(HTTPHelper.java:92)
    at com.springml.salesforce.wave.impl.ForceAPIImpl.query(ForceAPIImpl.java:120)
    at com.springml.salesforce.wave.impl.ForceAPIImpl.query(ForceAPIImpl.java:36)
    at com.az.sfget.SFGetTest.main(SFGetTest.java:54)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
    at sun.security.ssl.InputRecord.read(InputRecord.java:482)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)
    ... 21 more

0 个答案:

没有答案