javax.net.ssl.SSLException:无法识别的 SSL 消息,纯文本连接?
如何使用 axis jar 从 java 调用托管在 SSL(“https:”)协议上的 .net Web 服务 (asmx) 时解决上述异常。
执行代码时收到以下错误消息:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at com.ibm.jsse2.a.c(a.java:228)
at com.ibm.jsse2.a.a(a.java:63)
at com.ibm.jsse2.jc.a(jc.java:465)
at com.ibm.jsse2.jc.g(jc.java:458)
at com.ibm.jsse2.jc.a(jc.java:67)
at com.ibm.jsse2.jc.startHandshake(jc.java:342)
at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at examples.Example_client.main(Example_client.java:79)
{http://xml.apache.org/axis/}hostname:D-113020008
How to resolve the above exception while invoking a .net web service (asmx) hosted on SSL ("https:") protocol from java using axis jars.
Receving the following error message while executing the code:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at com.ibm.jsse2.a.c(a.java:228)
at com.ibm.jsse2.a.a(a.java:63)
at com.ibm.jsse2.jc.a(jc.java:465)
at com.ibm.jsse2.jc.g(jc.java:458)
at com.ibm.jsse2.jc.a(jc.java:67)
at com.ibm.jsse2.jc.startHandshake(jc.java:342)
at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at examples.Example_client.main(Example_client.java:79)
{http://xml.apache.org/axis/}hostname:D-113020008
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可能正在使用代理来获取 ssl 内容,但您的代理设置是错误的。您应该考虑使用 http 作为代理方案,然后使用 https 作为实际内容的方案。这解决了我的问题。
It is possible that you are using a proxy to get the ssl content, but your proxy setup is wrong. You should consider using http as proxy scheme, and then https as your scheme for the actual content. This solved my problem.
正如错误消息所示,对等方可能正在谈论明文,而不是 SSL。
As the error message says, the probability is that the peer is talking plaintext, not SSL.
当我的连接被复杂的防火墙规则阻止时,我曾经遇到过此错误。如果您已经到位,可能值得查看配置。
I have gotten this error before when my connection was being blocked by complex firewall rules. If you have in place it might be worth looking at the configuration.