SSLException:无法识别的 SSL 消息,AXIS java 应用程序中的纯文本连接错误

发布于 2024-11-02 00:32:36 字数 1163 浏览 3 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清风无影 2024-11-09 00:32:36
 System.getProperties().put( "proxySet", "true" );

那没有什么作用。消除。 JDK中没有这样的属性。

 System.getProperties().put( "proxyHost", host);
 System.getProperties().put( "proxyPort", port);

如果您使用 SSL,这些应该分别是 https.proxyHost/https.proxyPort。对于纯文本连接,http.proxyHost/http.proxyPort。

 System.getProperties().put( "proxySet", "true" );

That does nothing. Remove. There is no such property in the JDK.

 System.getProperties().put( "proxyHost", host);
 System.getProperties().put( "proxyPort", port);

If you are using SSL these should be https.proxyHost/https.proxyPort respectively. For plaintext connections, http.proxyHost/http.proxyPort.

青春有你 2024-11-09 00:32:36

无法解决这个问题。我们的应用程序是使用纯 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文