Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-69215

When specifying proxyAuthentication, plugin creates an Authorization header instead of a Proxy-Authorization header

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • http-request-plugin
    • None
    • http-request-plugin 1.14

      When utilizing httpRequest with an httpProxy defined along with proxyAuthentication

      httpRequest(url: "https://mytarget.contoso.com", httpProxy: 'http://my.authenticated.proxy.com:8080', proxyAuthentication: 'CREDENTIALS' ) 

      The plugin currently creates a request that defines an basic Authorization header with the values inside.

      Authorization: Basic Rk9POkJBUg== 

      The proxy does not know what to do with this and responds with a 407 challenge back.

      If I perform the same request utilizing curl I can see that it is constructing a Proxy-Authorization header that the proxy accepts and allows the traffic through.

      withCredentials([usernamePassword(credentialsId: 'CREDENTIALS', passwordVariable: 'PASSWORD', usernameVariable: 'USERNAME')]) {  sh (returnStdout: true, script: "curl -U "$USERNAME:$PASSWORD" -x http://my.authenticated.proxy.com:8080 -s -L https://mytarget.contoso.com")} 
      Proxy-Authorization: Basic Rk9POkJBUg==
      

       

            janario Janario Oliveira
            jakauppila Jared Kauppila
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: