Skip to content

[JENKINS-69215] When specifying proxyAuthentication, plugin creates an Authorization header instead of a Proxy-Authorization header #314

Description

@jenkins-infra-bot

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==

 


Originally reported by jakauppila, imported from: When specifying proxyAuthentication, plugin creates an Authorization header instead of a Proxy-Authorization header
  • assignee: janario
  • status: Open
  • priority: Major
  • component(s): http-request-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 2
  • imported: 20260702-081740
Raw content of original issue

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==

 

  • environment: http-request-plugin 1.14

Activity

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