我正在从unix批处理文件中调用一个Web服务,并成功发出了请求并获得了响应。
但是,当我从jsp页面调用相同的Web服务时,就会收到BAD_CERTIFICATE错误。
FATAL Alert:BAD_CERTIFICATE - A corrupt or unuseable certificate was received.
javax.net.ssl.SSLKeyException: FATAL Alert:BAD_CERTIFICATE - A corrupt or unuseable certificate was received.
at com.certicom.tls.interfaceimpl.TLSConnectionImpl.fireException(Unknown Source)
at com.certicom.tls.interfaceimpl.TLSConnectionImpl.fireAlertSent(Unknown Source)
at com.certicom.tls.record.handshake.HandshakeHandler.fireAlert(Unknown Source)
at com.certicom.tls.record.handshake.HandshakeHandler.handleHandshakeMessages(Unknown Source)
at com.certicom.tls.record.MessageInterpreter.interpretContent(Unknown Source)
at com.certicom.tls.record.MessageInterpreter.decryptMessage(Unknown Source)
at com.certicom.tls.record.ReadHandler.processRecord(Unknown Source)
at com.certicom.tls.record.ReadHandler.readRecord(Unknown Source)
at com.certicom.tls.record.ReadHandler.readUntilHandshakeComplete(Unknown Source)
at com.certicom.tls.interfaceimpl.TLSConnectionImpl.completeHandshake(Unknown Source)
at com.certicom.tls.record.WriteHandler.write(Unknown Source)
at com.certicom.io.OutputSSLIOStreamWrapper.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at java.io.FilterOutputStream.flush(FilterOutputStream.java:123)
at weblogic.net.http.HttpURLConnection.writeRequests(HttpURLConnection.java:150)
at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:364)
at weblogic.net.http.SOAPHttpsURLConnection.getInputStream(SOAPHttpsURLConnection.java:37)
at jsp_servlet._test._util.__testservice._jspService(__testservice.java:590)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:394)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:309)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3392)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
需要帮助。
谢谢。
最佳答案
通常的解决方案是启用JSSE,但是您使用的是非常旧的WLS版本。无论如何,按照Oracle KM:
根据您的情况设置以下JAVA_OPTIONS,然后重新启动服务器。
发布WLS 10.3.3
-Dweblogic.ssl.JSSEEnabled=true
-Dweblogic.wsee.client.ssl.usejdk=true
-Dweblogic.wsee.skip.async.response=true
-Dweblogic.wsee.client.ssl.stricthostchecking=false
-Dweblogic.webservice.client.ssl.adapterclass=weblogic.webservice.client.JSSEAdapter
WLS 10.3.2之前的版本
-Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol
-Dssl.SocketFactory.provider=com.sun.net.ssl.internal.SSLSocketFactoryImpl
-DUseSunHttpHandler=true
-Dweblogic.wsee.client.ssl.usejdk=true
-Dweblogic.wsee.skip.async.response=true
-Dweblogic.wsee.client.ssl.stricthostchecking=false
-Dweblogic.webservice.client.ssl.adapterclass=weblogic.webservice.client.JSSEAdapter
参考:FATAL警报:BAD_CERTIFICATE-与外部Web服务握手且证书不受Certicom支持时(文档ID 1671346.1)