- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我的 SSL 握手有一个小问题,当我尝试启动 GET 请求时,服务器返回 java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException。
我正在使用 Abdera 连接 Connections Server,在 Websphare 上我确实安装了 Connections Site 的 SSL,但这不起作用,我的代码是:
public static void send(HttpServletRequest req, HttpServletResponse respo) 抛出异常{
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 会发生什么或如何解决?
谢谢。
最佳答案
如果您在 WebSphere Application Server 上运行应用程序,则应将 Connections Server 导入 CellDefaultTrustSTore。
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.
之后你必须同步节点
关于java - Abdera SSLHandshakeException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32260527/
在日志中看到此错误消息,任何人都可以告诉发生了什么 “javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorExcep
我获得了一个 jar 文件,但无法访问代码(或无法修改)和一个 .cer ca 证书文件。 运行jar文件时;我收到此错误(我输入了 placeholder.hostname.com ): org.s
我需要忽略 PKIX 路径构建异常 javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PK
我正在尝试使用 HttpsURLConnection 与网站建立 HTTPS 连接,然后执行 PUT 请求。当我尝试从 HttpsURLConnection.getOutputStream() 创建
我的 SSL 握手有一个小问题,当我尝试启动 GET 请求时,服务器返回 java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException
非常感谢您阅读这篇文章,我们将不胜感激! 我正在尝试使用服务帐户在云端硬盘中列出和创建一个文本文件。已经生成了一个服务帐户,下载了 p12 文件也为该帐户启用了 Drive api。但是我收到了 SS
我使用 Retrofit2。添加服务器端 SSL 后请求不会执行。 onFailure 方法获取下一个 Throwable - javax.net.ssl.SSLHandshakeException:
这个问题在这里已经有了答案: Resolving javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorExce
我正在尝试使用自签名证书访问本地 https 站点。我修改了主机文件并为我的本地站点分配了一个 IP 地址;我用来访问网站的代码: String httpsURL = "https://test-s
我有一个服务到服务的连接,它间歇性地从 Jersey 客户端抛出 SSLHandshakeExceptions。 public static class MyClientFilter extends
我正在尝试创建端点以将我的谷歌应用引擎连接到我的 android 应用程序。我正在学习本教程 https://developers.google.com/eclipse/docs/endpoints-
使用这样的代码: val html = Source.fromURL("https://scans.io/json") 获取异常: Exception in thread "main" javax.n
我正在尝试从 Java 9 测试新的 HttpClient。出于测试目的,我正在使用 https://jsonplaceholder.typicode.com 提供的 api。 .但是,我收到握手异常
我正在寻找类似于 this answer 的解决方案,但更安全。我想禁用证书验证,但仅针对单个请求(这就是我所需要的)。所以它应该做以下一项或多项 完成一个请求后返回安全状态 仅对给定的 URL 禁用
当我访问 wsdl url 时,我在 android 中遇到异常 javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathVal
当我尝试使用 Java 代码以编程方式下载文件时,出现异常: Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.s
我们有一个 JavaFX 应用程序在 https 安全资源上调用我们的后端。该应用程序连续向同一个 url 发出数百个请求,以从服务器获取数据。 这通常没有问题,但现在我们有一个客户在连接到资源时报告
我正在尝试从 java 访问我的 api,但出现以下错误: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate
我最近在我的网站上添加了 SSL,可以通过 https 访问它。现在,当我的 Java 应用程序尝试向我的网站发出请求并使用缓冲读取器从中读取时,它会生成此堆栈跟踪 我没有使用自签名证书,该证书来自
我有两个代码示例,一个使用 Rest Template 和其他 Apache HttpClient 将 json 发布到我们的内部 https Web 服务。 我们的服务负载均衡器端存在这个已知的 S
我是一名优秀的程序员,十分优秀!