我们生产环境,在微信支付时,抛出异常:(用的是CloseablehttpClient连接,这是个偶发现象)
System Exception:javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:992)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at com.ms.config.wx.sdk.WeChatUtil.processHttpPost(WeChatUtil.java:555)
at com.ms.config.wx.sdk.WeChatUtil.unifiedorder(WeChatUtil.java:135)
at com.ms.tpp.service.handler.wechat.WechatMiniProgramPaymentServiceImpl.pay(WechatMiniProgramPaymentServiceImpl.java:78)
网上查了下设置系统参数,System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");升级JDK版本等
但这是个偶发现象,如果可以都可以,如果不可以都不可以,应该不是上面的方法能解决的。有大侠遇到过吗?要怎样解决呢?
我也遇到了,愁死了,解决了吗
我也遇到了一样的问题
你好,你的问题解决了么?我也遇到了一样的问题