Java 8u111 の発信プロキシの基本認証が失敗する

アトラシアン ナレッジベース

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。

問題

You want to configure outgoing proxy for any Atlassian product and that proxy requires basic authentication. Assuming that username/pass is correct, but you are still getting error: 407 Proxy Authentication Required

See the stack-trace: 

java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
        at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2124)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1546)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)

Typical Java environment variables for proxy: 

-Dhttp.proxyUser=test -Dhttp.proxyPassword=ping -Dhttp.proxyHost=172.16.47.128 -Dhttp.proxyPort=8080 -Dhttps.proxyUser=test -Dhttps.proxyPassword=ping -Dhttps.proxyHost=172.16.47.128 -Dhttps.proxyPort=808

See related:

診断

環境

  • Java version 8u111+

診断ステップ

  • You can capture TCP session and you can see that Java doesn't send Proxy-Authorization header. Eg:

    CONNECT confluence.atlassian.com:443 HTTP/1.1
    User-Agent: Java/1.8.0_92
    Host: confluence.atlassian.com
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Proxy-Connection: keep-alive

原因

In Java 8u111   Basic authentication for HTTPS tunneling was disabled by default.  

From  http://www.oracle.com/technetwork/java/javase/8u111-relnotes-3124969.html

In some environments, certain authentication schemes may be undesirable when proxying HTTPS. Accordingly, the Basic authentication scheme has been deactivated, by default, in the Oracle Java Runtime .. 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.

ソリューション

If you still want to use basic authentication for Proxy you can re-enable it. 

  • Add to Java environment:

    -Djdk.http.auth.tunneling.disabledSchemes=

説明

You want to configure an

outgoing proxy for any Atlassian product and that proxy requires basic authentication. Assuming that username/pass is correct, but you are still getting 
error: 407 Proxy Authentication Required
製品Jira, Confluence, Bitbucket, Bamboo, Fisheye, Crucible
プラットフォームサーバー
最終更新日: 2018 年 10 月 11 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.