Java Abdera Sslhandshake例外

Java Abdera Sslhandshake例外,java,ssl,websphere,ibm-connections,apache-abdera,Java,Ssl,Websphere,Ibm Connections,Apache Abdera,SSL握手有点问题,当我尝试启动GET请求时,服务器返回java.lang.RuntimeException:javax.net.SSL.SSLHandshakeException 我正在使用Abdera连接连接服务器,在Websphare上我安装了连接站点的SSL,但这不起作用,我的代码是: 公共静态无效sendHttpServletRequest请求,HttpServletResponse响应引发异常{ String back = ""; String connection

SSL握手有点问题,当我尝试启动GET请求时,服务器返回java.lang.RuntimeException:javax.net.SSL.SSLHandshakeException

我正在使用Abdera连接连接服务器,在Websphare上我安装了连接站点的SSL,但这不起作用,我的代码是:

公共静态无效sendHttpServletRequest请求,HttpServletResponse响应引发异常{

    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"));
日志是:

[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会发生这种情况,或者如何解决


thaks.

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

您可以将安全证书引用到


您必须在之后同步节点

是的,我这样做但不起作用,我已将证书添加到Websphere,但SSLhandshake异常仍在继续。您必须重新启动节点……您是独立运行Aberra还是作为AppServer的一部分运行?如果是独立运行,则必须将证书导入JVM的信任库请参阅本主题使用SSLthanks解决了问题,因为我使用了文档,并将证书添加到Websphere中,并对AbderaClient.registerTrustManager行和服务工作进行了注释。
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.