Skip to content

[JENKINS-48775] Proxy authentication error 407 even if 'check proxy' works #22494

Closed

Description

@jenkins-infra-bot

Proxy configuration doesn't work even if 'check proxy' works! No workaround found.

Situation: Fresh installed Windows Server 2016 with latest, fresh installed  LTS Jenkins version 2.89.2. Server is behind a proxy. Check of Jenkins proxy configuration says 'Ok' but checking plugins crashes jenkins (see attached screen shot).

I have a second machine (Windows 7 enterprise) with the same Jenkins version, behind the same proxy, with (really!) the same proxy configuration: Check Jenkins proxy settings says: "Error 407", BUT: Checking plugins works! (WTF!?!) One differrence is the java runtime verision: on this machine = 1.8.0_66-b18.


Originally reported by go, imported from: Proxy authentication error 407 even if 'check proxy' works
  • status: Resolved
  • priority: Critical
  • component(s): core
  • label(s): 2.150.1-rejected, 2.150.2-rejected, 2.150.3-rejected, Proxy
  • resolution: Fixed
  • resolved: 2018-11-20T14:53:06+00:00
  • votes: 7
  • watchers: 14
  • imported: 2025-11-24
Raw content of original issue

Proxy configuration doesn't work even if 'check proxy' works! No workaround found.

Situation: Fresh installed Windows Server 2016 with latest, fresh installed  LTS Jenkins version 2.89.2. Server is behind a proxy. Check of Jenkins proxy configuration says 'Ok' but checking plugins crashes jenkins (see attached screen shot).

I have a second machine (Windows 7 enterprise) with the same Jenkins version, behind the same proxy, with (really!) the same proxy configuration: Check Jenkins proxy settings says: "Error 407", BUT: Checking plugins works! (WTF!?!) One differrence is the java runtime verision: on this machine = 1.8.0_66-b18.

environment
awt.toolkit	sun.awt.windows.WToolkit<br/>
executable-war	D:\Jenkins\jenkins.war<br/>
file.encoding	Cp1252<br/>
file.encoding.pkg	sun.io<br/>
file.separator	\<br/>
hudson.lifecycle	hudson.lifecycle.WindowsServiceLifecycle<br/>
java.awt.graphicsenv	sun.awt.Win32GraphicsEnvironment<br/>
java.awt.headless	true<br/>
java.awt.printerjob	sun.awt.windows.WPrinterJob<br/>
java.class.path	D:\Jenkins\jenkins.war<br/>
java.class.version	52.0<br/>
java.endorsed.dirs	D:\Jenkins\jre\lib\endorsed<br/>
java.ext.dirs	D:\Jenkins\jre\lib\ext;C:\Windows\Sun\Java\lib\ext<br/>
java.home	D:\Jenkins\jre<br/>
java.library.path	D:\Jenkins\jre\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;.<br/>
java.runtime.name	Java(TM) SE Runtime Environment<br/>
java.runtime.version	1.8.0_144-b01<br/>
java.specification.name	Java Platform API Specification<br/>
java.specification.vendor	Oracle Corporation<br/>
java.specification.version	1.8<br/>
java.vendor	Oracle Corporation<br/>
java.vendor.url	<a href="http://java.oracle.com/">http://java.oracle.com/</a><br/>
java.vendor.url.bug	<a href="http://bugreport.sun.com/bugreport/">http://bugreport.sun.com/bugreport/</a><br/>
java.version	1.8.0_144<br/>
java.vm.info	mixed mode<br/>
java.vm.name	Java HotSpot(TM) Client VM<br/>
java.vm.specification.name	Java Virtual Machine Specification<br/>
java.vm.specification.vendor	Oracle Corporation<br/>
java.vm.specification.version	1.8<br/>
java.vm.vendor	Oracle Corporation<br/>
java.vm.version	25.144-b01<br/>
jna.loaded	true<br/>
line.separator	<br/>
os.arch	x86<br/>
os.name	Windows Server 2016<br/>
os.version	10.0<br/>
path.separator	;<br/>
sun.arch.data.model	32<br/>
sun.boot.class.path	D:\Jenkins\jre\lib\resources.jar;D:\Jenkins\jre\lib\rt.jar;D:\Jenkins\jre\lib\sunrsasign.jar;D:\Jenkins\jre\lib\jsse.jar;D:\Jenkins\jre\lib\jce.jar;D:\Jenkins\jre\lib\charsets.jar;D:\Jenkins\jre\lib\jfr.jar;D:\Jenkins\jre\classes<br/>
sun.boot.library.path	D:\Jenkins\jre\bin<br/>
sun.cpu.endian	little<br/>
sun.cpu.isalist	pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86<br/>
sun.desktop	windows<br/>
sun.io.unicode.encoding	UnicodeLittle<br/>
sun.java.command	D:\Jenkins\jenkins.war --httpPort=8080 --webroot=D:\Jenkins\war<br/>
sun.java.launcher	SUN_STANDARD<br/>
sun.jnu.encoding	Cp1252<br/>
sun.management.compiler	HotSpot Client Compiler<br/>
sun.os.patch.level	<br/>
user.country	US<br/>
user.country.format	AT<br/>
user.dir	D:\Jenkins<br/>
user.language	en<br/>
user.language.format	de<br/>
user.script	<br/>
user.timezone	Europe/Berlin<br/>
user.variant	<br/>
Umgebungsvariablen<br/>
Name  ↓<br/>
Wert   <br/>
ALLUSERSPROFILE	C:\ProgramData<br/>
BASE	D:\Jenkins<br/>
CommonProgramFiles	C:\Program Files (x86)\Common Files<br/>
CommonProgramFiles(x86)	C:\Program Files (x86)\Common Files<br/>
CommonProgramW6432	C:\Program Files\Common Files<br/>
ComSpec	C:\Windows\system32\cmd.exe<br/>
JENKINS_HOME	D:\Jenkins<br/>
NUMBER_OF_PROCESSORS	2<br/>
OS	Windows_NT<br/>
Path	C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\<br/>
PATHEXT	.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC<br/>
PROCESSOR_ARCHITECTURE	x86<br/>
PROCESSOR_ARCHITEW6432	AMD64<br/>
PROCESSOR_IDENTIFIER	Intel64 Family 6 Model 26 Stepping 4, GenuineIntel<br/>
PROCESSOR_LEVEL	6<br/>
PROCESSOR_REVISION	1a04<br/>
ProgramData	C:\ProgramData<br/>
ProgramFiles	C:\Program Files (x86)<br/>
ProgramFiles(x86)	C:\Program Files (x86)<br/>
ProgramW6432	C:\Program Files<br/>
PSModulePath	%ProgramFiles%\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules<br/>
PUBLIC	C:\Users\Public<br/>
RANDFILE	C:\ProgramData\.rnd<br/>
SERVICE_ID	Jenkins<br/>
SystemDrive	C:<br/>
SystemRoot	C:\Windows<br/>
UATDATA	C:\Windows\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77<br/>
windir	C:\Windows<br/>
WINSW_EXECUTABLE	D:\Jenkins\jenkins.exe<br/>
WINSW_SERVICE_ID	Jenkins<br/>
Plugins:<br/>
Keine Plugins installiert.
1 attachment

Activity

  1. jenkins-infra-bot commented on Jan 2, 2018

    @jenkins-infra-bot
    Author
  2. jenkins-infra-bot commented on Jan 2, 2018

    @jenkins-infra-bot
    Author
    orrc:
    • Original comment link
    • Raw content of original comment:

      From the release notes:

      Default the built-in Jenkins Update Center URL to https://updates.jenkins.io instead of obsolete HTTP endpoint. This requires a JRE compatible with Let's Encrypt, e.g. Oracle JRE 8u101.

      i.e. as you mention, the Java version makes a difference.

    From the release notes:

    Default the built-in Jenkins Update Center URL to https://updates.jenkins.io instead of obsolete HTTP endpoint. This requires a JRE compatible with Let's Encrypt, e.g. Oracle JRE 8u101.

    i.e. as you mention, the Java version makes a difference.

  3. jenkins-infra-bot commented on Jan 2, 2018

    @jenkins-infra-bot
    Author
    go:
    • Original comment link
    • Raw content of original comment:

      Hi Christopher,

      at first thank you for your fast answer! Unfortunately, the situation on my both Jenkins servers is inverted: That one with JRE 1.8.0_66-b18 is working and the one with 1.8.0_144-b01 isn't working. Even the 'proxy check' is the other way around.

      bg Gerald

       

    Hi Christopher,

    at first thank you for your fast answer!
    Unfortunately, the situation on my both Jenkins servers is inverted: That one with JRE 1.8.0_66-b18 is working and the one with 1.8.0_144-b01 isn't working. Even the 'proxy check' is the other way around.

    bg Gerald

     

  4. jenkins-infra-bot commented on Jan 3, 2018

    @jenkins-infra-bot
    Author
    go:
    • Original comment link
    • Raw content of original comment:

      due to the situation that the Jenkins Server with the newer JRE makes the troubles => still an issue.

       

    due to the situation that the Jenkins Server with the newer JRE makes the troubles => still an issue.

     

  5. jenkins-infra-bot commented on Jan 12, 2018

    @jenkins-infra-bot
    Author
    go:
    • Original comment link
    • Raw content of original comment:

      Hi rtyler,

      I have new gained insights of this problem:

      After consulting out IT guys, it was clear that the Jenkins server DON'T send any authentication to the proxy (maybe except when pressing 'check proxy'). So there were made two configurations on the company proxy server: 1. added 'https://updates.jenkins.io' to the 'DoNotAuthenticate whitelist' 2. turned off the 'SSL Interception' for this URL Now, with this workaround, checking and downloading plugin works! But that can't be the final solution!

      Thank you for your effort!

      BG Gerald

       

    Hi rtyler,

    I have new gained insights of this problem:

    After consulting out IT guys, it was clear that the Jenkins server DON'T send any authentication to the proxy (maybe except when pressing 'check proxy').
    So there were made two configurations on the company proxy server:
    1. added 'https://updates.jenkins.io' to the 'DoNotAuthenticate whitelist'
    2. turned off the 'SSL Interception' for this URL
    Now, with this workaround, checking and downloading plugin works! But that can't be the final solution!

    Thank you for your effort!

    BG Gerald

     

  6. jenkins-infra-bot commented on Jan 18, 2018

    @jenkins-infra-bot
    Author
    onodera:
    • Original comment link
    • Raw content of original comment:

      I can confirm that I have the same problem with Jenkins 2.89.3 running on Oracle JRE 8u161 for x64 Linux: proxy configuration check succeeds, checking for plugins on Jenkins updates produces a stack trace about HTTP error 407.

    I can confirm that I have the same problem with Jenkins 2.89.3 running on Oracle JRE 8u161 for x64 Linux: proxy configuration check succeeds, checking for plugins on Jenkins updates produces a stack trace about HTTP error 407.

  7. jenkins-infra-bot commented on Jan 25, 2018

    @jenkins-infra-bot
    Author
    ausername:
    • Original comment link
    • Raw content of original comment:

      Jenkins 2.101 here. Proxy Settings OK Update Center / Advanced  Proxy / Test OK wget from within the docker container (when setting the proxy there): OK wget from the host machine OK Trying to get the plugin update infos - fails.

      Proxy doesn't need an authentification.

    Jenkins 2.101 here.
    Proxy Settings OK
    Update Center / Advanced  Proxy / Test OK
    wget from within the docker container (when setting the proxy there): OK
    wget from the host machine OK
    Trying to get the plugin update infos - fails.

    Proxy doesn't need an authentification.

  8. jenkins-infra-bot commented on Jan 31, 2018

    @jenkins-infra-bot
    Author
    go:
    • Original comment link
    • Raw content of original comment:

      Now I saw the difference of fetching the updates: The machine with the older JRE version checks '[*http://updates.jenkins-ci.org/update-center.json*'] and the newer one (fresh installled Jenklins 2.89.2) calls '*https://updates.jenkins.io/update-center.json'*!

      So this exlains the different behavier but not what's going on in the newer Jenkins software!

      bg Gerald

    Now I saw the difference of fetching the updates: The machine with the older JRE version checks '[*http://updates.jenkins-ci.org/update-center.json*'] and the newer one (fresh installled Jenklins 2.89.2) calls '*https://updates.jenkins.io/update-center.json'*!

    So this exlains the different behavier but not what's going on in the newer Jenkins software!

    bg Gerald

  9. jenkins-infra-bot commented on Feb 1, 2018

    @jenkins-infra-bot
    Author
    ausername:
    • Original comment link
    • Raw content of original comment:

      Jenkins Docker Container with V2.101 and Java 1.8.0.151 still an issue

    Jenkins Docker Container with V2.101 and Java 1.8.0.151 still an issue

  10. jenkins-infra-bot commented on Feb 6, 2018

    @jenkins-infra-bot
    Author
    stephenconnolly:
    • Original comment link
    • Raw content of original comment:

      WORKAROUND:

      This is crazy, but will work...

      Run the following in the script console:

      ProxyConfiguration.open(new java.net.URL("http://jenkins.io")).content

      Then the update center should work... unclear why this works at this point in time!

    WORKAROUND:

    This is crazy, but will work...

    Run the following in the script console:

    ProxyConfiguration.open(new java.net.URL("http://jenkins.io")).content

    Then the update center should work... unclear why this works at this point in time!

  11. jenkins-infra-bot commented on Feb 6, 2018

    @jenkins-infra-bot
    Author
    stephenconnolly:
    • Original comment link
    • Raw content of original comment:

      Interestingly...

      ProxyConfiguration.open(new java.net.URL("https://jenkins.io")).content

      Will give the 

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

      error... looks like a JDK bug whereby the HttpsURLConnectionImpl wherein it will fail to setup a connection to the proxy but will reuse an existing one

       

    Interestingly...

    ProxyConfiguration.open(new java.net.URL("https://jenkins.io")).content

    Will give the 

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

    error... looks like a JDK bug whereby the HttpsURLConnectionImpl wherein it will fail to setup a connection to the proxy but will reuse an existing one

     

  12. jenkins-infra-bot commented on Feb 6, 2018

    @jenkins-infra-bot
    Author
    stephenconnolly:
    • Original comment link
    • Raw content of original comment:

      Ok, so Http URLs will populate the sun.net.www.protocol.http.AuthenticationInfo.cache.hashtable but Https URLs will not populate, only consult

    Ok, so Http URLs will populate the sun.net.www.protocol.http.AuthenticationInfo.cache.hashtable but Https URLs will not populate, only consult

  13. jenkins-infra-bot commented on Feb 6, 2018

    @jenkins-infra-bot
    Author
    stephenconnolly:
    • Original comment link
    • Raw content of original comment:

      FYI the workaround may only last for a short-ish period of time as the cache seems to get purged under circumstances I have been unable to determine

    FYI the workaround may only last for a short-ish period of time as the cache seems to get purged under circumstances I have been unable to determine

  14. jenkins-infra-bot commented on May 9, 2018

    @jenkins-infra-bot
    Author
    israelromero:
    • Original comment link
    • Raw content of original comment:

      Same issue with 2.107.2 version 

    Same issue with 2.107.2 version 

  15. jenkins-infra-bot commented on Jun 6, 2018

    @jenkins-infra-bot
    Author
    harrygg:
    • Original comment link
    • Raw content of original comment:

      For us it is fixed, probably either by removal of a duplicate update center we had (same update center twice, disappeared after update and restart) or with the update to 2.107.3 (possibly related in the changelog: "Add new update center root CA certificate. (INFRA-1502)" ?)

    For us it is fixed, probably either by removal of a duplicate update center we had (same update center twice, disappeared after update and restart) or with the update to 2.107.3 (possibly related in the changelog: "Add new update center root CA certificate. (INFRA-1502)" ?)

  16. 1 remaining item

  17. jenkins-infra-bot commented on Oct 25, 2018

    @jenkins-infra-bot
    Author
    fuku1026:
    • Original comment link
    • Raw content of original comment:

      Same issue with 2.138.2 version

    Same issue with 2.138.2 version

  18. jenkins-infra-bot commented on Oct 25, 2018

    @jenkins-infra-bot
    Author
    israelromero:
    • Original comment link
    • Raw content of original comment:

      I respond to myself here to help anyone with same issue.

      The problem wasn't Jenkins. Problem comes from Java JDK8 and above. Since this version, Oracle has disabled basic auth tunnelling for Basic authentication. If you want to use Basic mode again (security will be compromised), execute Jenkins adding this parameter to your JAVA_OPTS variable:

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

      default value is

        "-Djdk.http.auth.tunneling.disabledSchemes=Basic", so Basic Schema is DISABLED by default and will return HTTP 407 error even if your credentials were OK.

       Proxy checking must use other method to validate Internet connection...

      I hope this can help you, guys.

       

    I respond to myself here to help anyone with same issue.

    The problem wasn't Jenkins. Problem comes from Java JDK8 and above. Since this version, Oracle has disabled basic auth tunnelling for Basic authentication. If you want to use Basic mode again (security will be compromised), execute Jenkins adding this parameter to your JAVA_OPTS variable:

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

    default value is

      "-Djdk.http.auth.tunneling.disabledSchemes=Basic", so Basic Schema is DISABLED by default and will return HTTP 407 error even if your credentials were OK.

     Proxy checking must use other method to validate Internet connection...

    I hope this can help you, guys.

     

  19. jenkins-infra-bot commented on Oct 31, 2018

    @jenkins-infra-bot
    Author
    stephenconnolly:
    • Original comment link
    • Raw content of original comment:

      Removing myself as assignee. My current work assignments do not provide sufficient bandwidth to review these issues and in the majority of cases I am only assigned by virtue of being the default assignee. For the credentials-api and scm-api related plugins I have permission to allocate time reviewing changes to these APIs themselves to ensure these APIs remain cohesive, but that can be handled through PR reviews rather than assigning issues in JIRA

    Removing myself as assignee. My current work assignments do not provide sufficient bandwidth to review these issues and in the majority of cases I am only assigned by virtue of being the default assignee. For the credentials-api and scm-api related plugins I have permission to allocate time reviewing changes to these APIs themselves to ensure these APIs remain cohesive, but that can be handled through PR reviews rather than assigning issues in JIRA

  20. jenkins-infra-bot commented on Nov 21, 2018

    @jenkins-infra-bot
    Author
    olivergondza:
    • Original comment link
    • Raw content of original comment:

      Postponing backport until 2.150.2 at least to give it some soak time.

    Postponing backport until 2.150.2 at least to give it some soak time.

  21. jenkins-infra-bot commented on Dec 4, 2018

    @jenkins-infra-bot
    Author
    danielbeck:

    This introduced JENKINS-54903.

  22. jenkins-infra-bot commented on Nov 24, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-54903]

  23. jenkins-infra-bot commented on Nov 24, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-42089]

  24. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions