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

时间:2021-08-01 19:38:07

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:

我有java应用程序使用Axis从Web服务获取数据。通过HTTPS访问Web服务。它在我的本地PC上工作正常,但客户使用代理。我添加了代理设置:

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?

有人可以帮忙吗?

2 个解决方案

#1


0  

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

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

这没什么。去掉。 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.

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

#2


0  

Was unable to solve this problem. Our app was rewritten using plain HTTP POST requests (with Apache HTTPClient 3.0), i.e. without Axis.

无法解决这个问题。我们的应用程序使用普通的HTTP POST请求(使用Apache HTTPClient 3.0)重写,即没有Axis。

#1


0  

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

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

这没什么。去掉。 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.

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

#2


0  

Was unable to solve this problem. Our app was rewritten using plain HTTP POST requests (with Apache HTTPClient 3.0), i.e. without Axis.

无法解决这个问题。我们的应用程序使用普通的HTTP POST请求(使用Apache HTTPClient 3.0)重写,即没有Axis。