首页 文章

HttpClient抛出SSLException:收到致命警报:decode_error

提问于
浏览
0

我有一个在Websphere 8.5上运行的Java应用程序 . 我试图使用下面的代码调用第三方Web服务,但它失败了SSLException如下 .

HttpClient httpClient = new HttpClient();
PostMethod post = new PostMethod(clientURL); 
post.addRequestHeader(....blah);    
httpClient.executeMethod(post);  // The error is thrown at this line `

它失败并出现以下错误:

HttpMethodDir I org.apache.commons.httpclient.HttpMethodDirector executeWithRetry I/O exception (javax.net.ssl.SSLException) caught when processing request: Received fatal alert: decode_error`

下面是完整的堆栈跟踪:

[8/21/15 16:33:08:997 EDT] 00000093 HttpMethodDir I org.apache.commons.httpclient.HttpMethodDirector executeWithRetry处理请求时捕获的I / O异常(javax.net.ssl.SSLException):收到致命警报:decode_error [8/21/15 16:33:08:997 EDT] 00000093 HttpMethodDir I org.apache.commons.httpclient.HttpMethodDirector executeWithRetry重试请求[8/21/15 16:33:09:059 EDT] 00000093 HttpMethodDir I处理请求时捕获的org.apache.commons.httpclient.HttpMethodDirector executeWithRetry I / O异常(javax.net.ssl.SSLException):收到致命警报:decode_error [8/21/15 16:33:09:059 EDT] 00000093 HttpMethodDir我org.apache.commons.httpclient.HttpMethodDirector executeWithRetry重试请求[8/21/15 16:33:09:122 EDT] 00000093 HttpMethodDir我org.apache.commons.httpclient.HttpMethodDirector executeWithRetry I / O异常(javax.net . 处理请求时捕获的ssl.SSLException:收到致命警报:decode_error [8/21/15 16:33:09:122 EDT] 00000093 HttpMeth odDir I org.apache.commons.httpclient.HttpMethodDirector executeWithRetry重试请求[8/21/15 16:33:09:168 EDT] 00000093 SystemOut O在MessageSender中....结束sendMessage()[8/21/15 16 :33:09:168 EDT] 00000093 servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0014E:未捕获的service()异常根本原因/cova.jsp:com.ibm.websphere.servlet.error.ServletErrorReport:com .company.exception.ClientCommunicationException:在com.ibm的com.ibm._jsp._cova._jspService(_cova.java:147)的org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:695)没有收到任何响应.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:99)位于com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper)的javax.servlet.http.HttpServlet.service(HttpServlet.java:668) .java:1225)com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:775)at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:457) )com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)位于com.ibm.ws的com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122) . jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:216)at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1032)at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest( WebApp.java:3761)在com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)在com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:975)在com.ibm .ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)在com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)在com.ibm.ws.http.channel.inbound.impl .httpInboundLink.handleDiscrimination(HttpInboundLink.java:459)at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpI nboundLink.java:526)在com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)在com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready( HttpInboundLink.java:283)在com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)在com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java: 113)在com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)在com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)在com.ibm.io .async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)在com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)在com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204 )com.ibm.io.async.Result.RerultHandler $ 2.run(ResultHandler . )中的com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) . java:905)at com.ibm.ws.util.ThreadPool $ Worker.run(ThreadPool.java:1815)

-谢谢 .

1 回答

  • 1

    我在这里猜,但这里有几种可能性......

    要么A:你应该使用http与您的帖子网址中的https相反(反之亦然)

    B:您使用的是https,SSL证书无效

    或者C:您使用了正确的URL并且SSL有效但您提供给API的身份验证无效且第三方API无法很好地处理

相关问题