Java Web Start:自 Java 8 Update 111 以来无法通过代理建立隧道

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41806422/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 23:41:25  来源:igfitidea点击:

Java Web Start: Unable to tunnel through proxy since Java 8 Update 111

javahttpsproxyjava-web-starttunneling

提问by Marcus

Some of our customers cannot run our Java Web Start client anymore since Java 8 Update 111. They get:

自 Java 8 Update 111 以来,我们的一些客户无法再运行我们的 Java Web Start 客户端。他们得到:

java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required

java.io.IOException:无法通过代理建立隧道。代理返回“需要 HTTP/1.1 407 代理身份验证

Looks like it has to do with this change:

看起来它与此更改有关

Now, proxies requiring Basic authentication when setting up a tunnel for HTTPS will no longer succeed by default. If required, this authentication scheme can be reactivated by removing Basic from the jdk.http.auth.tunneling.disabledSchemes networking property, or by setting a system property of the same name to "" ( empty ) on the command line.

现在,默认情况下,在为 HTTPS 设置隧道时需要基本身份验证的代理将不再成功。如果需要,可以通过从 jdk.http.auth.tunneling.disabledSchemes 网络属性中删除 Basic 或通过在命令行上将同名的系统属性设置为 ""(空)来重新激活此身份验证方案。

Is there any way if customers are not willing to change their proxy authentication method?

如果客户不愿意改变他们的代理身份验证方法,有什么办法吗?

Note:Adding <property name="jdk.http.auth.tunneling.disabledSchemes" value=""/>to <resources>of the JNLP has no effect. This is because only a few properties are supported this way (there is a list near the bottom of this page). "jdk.http.auth.tunneling.disabledSchemes" is not among them.

注意:添加<property name="jdk.http.auth.tunneling.disabledSchemes" value=""/><resources>JNLP 没有效果。这是因为这种方式仅支持少数属性(此页面底部附近有一个列表)。“jdk.http.auth.tunneling.disabledSchemes”不在其中。

采纳答案by Marcus

I found out that there is one way, but not in the hands of the developer: The user can add

我发现有一种方法,但不在开发者手中:用户可以添加

-Djdk.http.auth.tunneling.disabledSchemes=""

for Java 8 in Java Control Panel → Java → View... → Runtime Parameters

对于 Java 8 中的 Java 控制面板 → Java → 查看... → 运行时参数

for Java 9 in Java Control Panel → Desktop Settings → Runtime Parameters

Java 9 中的 Java 控制面板 → 桌面设置 → 运行时参数

回答by jan

Beside the answer of mbee one can also configure this in the net.propertiesfile of the jre:

除了 mbee 的答案之外,还可以在net.propertiesjre的文件中进行配置:

C:\Program Files (x86)\Java\jre1.8.0_131\lib\net.properties

C:\Program Files (x86)\Java\jre1.8.0_131\lib\net.properties

Currently last line 100 need to be commented out:

目前最后一行 100 需要注释掉:

Before:

前:

 #jdk.http.auth.proxying.disabledSchemes=
 jdk.http.auth.tunneling.disabledSchemes=Basic

After:

后:

 #jdk.http.auth.proxying.disabledSchemes=
 #jdk.http.auth.tunneling.disabledSchemes=Basic

Note that both answers need to be repeated after a Java Update, although the Java Auto Update is deactivated with Basic Internet Proxy Authentication.

请注意,尽管 Java 自动更新已通过基本 Internet 代理身份验证停用,但在 Java 更新后需要重复这两个答案。

回答by bj03rnv0ss

If you require to do this at runtime you can set the value of the jdk.http.auth.proxying.disabledSchemesproperty by adding

如果您需要在运行时执行此操作,您可以通过添加来设置jdk.http.auth.proxying.disabledSchemes属性的值

System.setProperty("jdk.http.auth.tunneling.disabledSchemes", "");

to the main method of your application.

到您的应用程序的主要方法。

回答by David Elsener

I had this issue too while trying to access an external SOAP Webservice trough a Proxy-Server using BASIC-Authentification for an application running on Apache Tomcat.

在尝试通过代理服务器访问外部 SOAP Web 服务时,我也遇到了这个问题,使用 BASIC-Authentification 为运行在 Apache Tomcat 上的应用程序。

Setting the property programmatically (System.setProperty("jdk.http.auth.tunneling.disabledSchemes", "");) during application initialization did not work. It had to be set as VM-Argument or (not very nice way of course :)) in [JRE_HOME]\lib\net.properties.

在应用程序初始化期间以编程方式设置属性(System.setProperty("jdk.http.auth.tunneling.disabledSchemes", "");不起作用。它必须在 [JRE_HOME]\lib\net.properties 中设置为 VM-Argument 或(当然不是很好的方式:))。