SSLException:无法识别的 SSL 消息,AXIS java 应用程序中的纯文本连接错误
我有一个 java 应用程序,它使用 Axis 从 Web 服务获取数据。 Web 服务通过 HTTPS 访问。它在我的本地电脑上运行良好,但客户使用代理。我添加了代理设置:
System.getProperties().put( "proxySet", "true" );
System.getProperties().put( "proxyHost", host);
System.getProperties().put( "proxyPort", port);
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username,
password.toCharArray());
}
});
但客户遇到异常:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
...
有人可以帮忙吗?
I have java app that uses Axis to get data from web service. web service is accessed via HTTPS. It works fine on my local PC, but customer uses proxy. I added setting for proxy:
System.getProperties().put( "proxySet", "true" );
System.getProperties().put( "proxyHost", host);
System.getProperties().put( "proxyPort", port);
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username,
password.toCharArray());
}
});
but customers get exception:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
...
Can anybody help here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
那没有什么作用。消除。 JDK中没有这样的属性。
如果您使用 SSL,这些应该分别是 https.proxyHost/https.proxyPort。对于纯文本连接,http.proxyHost/http.proxyPort。
That does nothing. Remove. There is no such property in the JDK.
If you are using SSL these should be https.proxyHost/https.proxyPort respectively. For plaintext connections, http.proxyHost/http.proxyPort.
无法解决这个问题。我们的应用程序是使用纯 HTTP POST 请求(使用 Apache HTTPClient 3.0)重写的,即没有 Axis。
Was unable to solve this problem. Our app was rewritten using plain HTTP POST requests (with Apache HTTPClient 3.0), i.e. without Axis.