首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Abdera SSLHandshakeException

Abdera SSLHandshakeException
EN

Stack Overflow用户
提问于 2015-08-27 22:35:13
回答 1查看 324关注 0票数 0

我的SSL握手有点问题,如果我试图启动一个GET请求,服务器将返回me java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException。

我使用Abdera与Connections连接,在Websphare上我确实安装了连接站点的SSL,但是这种方法不起作用,我的代码是:

公共静态空发送(HttpServletRequest req,HttpServletResponse respo)抛出异常{

代码语言:javascript
复制
    String back = "";

    String connectionsUser = req.getHeader("user");
    String connectionsPassword = req.getHeader("password");

    Abdera abdera = new Abdera();
    AbderaClient abderaClient = new AbderaClient(abdera);

    AbderaClient.registerTrustManager();

    System.out.println(connectionsUser + "    " + connectionsPassword);
    abderaClient.addCredentials(Utils.configJson.getString("connectionsServer"), null, null, new UsernamePasswordCredentials(connectionsUser, connectionsPassword));

    ClientResponse resp = abderaClient.get(Utils.configJson.getString("connectionsServerURL") + Utils.configJson.getString("profileService"));

而日志--它是:

代码语言:javascript
复制
[8/27/15 17:14:56:663 CDT] 0000007c SystemErr     R java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
[8/27/15 17:14:56:664 CDT] 0000007c SystemErr     R     at org.apache.abdera.protocol.client.AbderaClient.execute(AbderaClient.java:701)
[8/27/15 17:14:56:664 CDT] 0000007c SystemErr     R     at org.apache.abdera.protocol.client.AbderaClient.get(AbderaClient.java:216)
[8/27/15 17:14:56:664 CDT] 0000007c SystemErr     R     at org.apache.abdera.protocol.client.AbderaClient.get(AbderaClient.java:404)
[8/27/15 17:14:56:664 CDT] 0000007c SystemErr     R     at com.cemex.services.ProfileServiceDo.send(ProfileServiceDo.java:71)
[8/27/15 17:14:56:664 CDT] 0000007c SystemErr     R     at com.cemex.services.ProfileServiceDo.doGet(ProfileServiceDo.java:38)
[8/27/15 17:14:56:664 CDT] 0000007c SystemErr     R     at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
[8/27/15 17:14:56:664 CDT] 0000007c SystemErr     R     at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
[8/27/15 17:14:56:664 CDT] 0000007c SystemErr     R     at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
[8/27/15 17:14:56:664 CDT] 0000007c SystemErr     R     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
[8/27/15 17:14:56:665 CDT] 0000007c SystemErr     R     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
[8/27/15 17:14:56:665 CDT] 0000007c SystemErr     R     at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
[8/27/15 17:14:56:665 CDT] 0000007c SystemErr     R     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1071)
[8/27/15 17:14:56:665 CDT] 0000007c SystemErr     R     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3774)
[8/27/15 17:14:56:665 CDT] 0000007c SystemErr     R     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
[8/27/15 17:14:56:665 CDT] 0000007c SystemErr     R     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:981)
[8/27/15 17:14:56:665 CDT] 0000007c SystemErr     R     at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
[8/27/15 17:14:56:665 CDT] 0000007c SystemErr     R     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
[8/27/15 17:14:56:665 CDT] 0000007c SystemErr     R     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
[8/27/15 17:14:56:665 CDT] 0000007c SystemErr     R     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
[8/27/15 17:14:56:665 CDT] 0000007c SystemErr     R     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
[8/27/15 17:14:56:665 CDT] 0000007c SystemErr     R     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:277)
[8/27/15 17:14:56:665 CDT] 0000007c SystemErr     R     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
[8/27/15 17:14:56:665 CDT] 0000007c SystemErr     R     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
[8/27/15 17:14:56:666 CDT] 0000007c SystemErr     R     at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
[8/27/15 17:14:56:666 CDT] 0000007c SystemErr     R     at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[8/27/15 17:14:56:666 CDT] 0000007c SystemErr     R     at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[8/27/15 17:14:56:666 CDT] 0000007c SystemErr     R     at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
[8/27/15 17:14:56:666 CDT] 0000007c SystemErr     R     at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
[8/27/15 17:14:56:666 CDT] 0000007c SystemErr     R     at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
[8/27/15 17:14:56:666 CDT] 0000007c SystemErr     R     at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
[8/27/15 17:14:56:666 CDT] 0000007c SystemErr     R     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1702)
[8/27/15 17:14:56:666 CDT] 0000007c SystemErr     R Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
[8/27/15 17:14:56:666 CDT] 0000007c SystemErr     R     at com.ibm.jsse2.o.a(o.java:36)
[8/27/15 17:14:56:668 CDT] 0000007c SystemErr     R     at com.ibm.jsse2.o.a(o.java:43)
[8/27/15 17:14:56:668 CDT] 0000007c SystemErr     R     at com.ibm.jsse2.SSLSocketImpl.b(SSLSocketImpl.java:32)
[8/27/15 17:14:56:668 CDT] 0000007c SystemErr     R     at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:626)
[8/27/15 17:14:56:668 CDT] 0000007c SystemErr     R     at com.ibm.jsse2.SSLSocketImpl.h(SSLSocketImpl.java:39)
[8/27/15 17:14:56:668 CDT] 0000007c SystemErr     R     at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:696)
[8/27/15 17:14:56:668 CDT] 0000007c SystemErr     R     at com.ibm.jsse2.k.write(k.java:26)
[8/27/15 17:14:56:668 CDT] 0000007c SystemErr     R     at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:76)
[8/27/15 17:14:56:668 CDT] 0000007c SystemErr     R     at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:134)
[8/27/15 17:14:56:668 CDT] 0000007c SystemErr     R     at org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java:827)
[8/27/15 17:14:56:668 CDT] 0000007c SystemErr     R     at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.flushRequestOutputStream(MultiThreadedHttpConnectionManager.java:1525)
[8/27/15 17:14:56:668 CDT] 0000007c SystemErr     R     at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1975)
[8/27/15 17:14:56:668 CDT] 0000007c SystemErr     R     at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)
[8/27/15 17:14:56:668 CDT] 0000007c SystemErr     R     at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
[8/27/15 17:14:56:669 CDT] 0000007c SystemErr     R     at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
[8/27/15 17:14:56:669 CDT] 0000007c SystemErr     R     at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
[8/27/15 17:14:56:669 CDT] 0000007c SystemErr     R     at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
[8/27/15 17:14:56:669 CDT] 0000007c SystemErr     R     at org.apache.abdera.protocol.client.AbderaClient.execute(AbderaClient.java:688)
[8/27/15 17:14:56:669 CDT] 0000007c SystemErr     R     ... 30 more

您知道SSL会发生什么情况,或者如何解决?

塔斯。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-08-27 23:18:34

如果在CellDefaultTrustSTore应用服务器上运行应用程序,则应将连接服务器导入WebSphere。

您可以将安全证书引用到network.dita

代码语言:javascript
复制
Log into the IBM WebSphere Application Server Integrated Solutions Console and select Security > SSL Certificate and key management > Key stores and certificates.
Click CellDefaultTrustStore.
Click Signer Certificates.
Click Retrieve from port.
Enter the Host name, SSL Port, and Alias of the web server. The Alias is typically an arbitrary string that will become the name of the credentials.
Click Retrieve Signer Information and then click OK. The root certificate is added to the list of signer certificates.

之后,必须同步节点。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32260527

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档