Skip to content

use proxy env PROXY_HOST and PROXY_PORT automatically if defined - #92

Open
luka5 wants to merge 1 commit into
jenkinsci:masterfrom
luka5:issue-66/use-proxy-from-env
Open

luka5 wants to merge 1 commit into
jenkinsci:masterfrom
luka5:issue-66/use-proxy-from-env

Conversation

@luka5

@luka5 luka5 commented Nov 18, 2020

Copy link
Copy Markdown

With this change, we will automatically use the PROXY_HOST and PROXY_PORT environment variables, if defined.
This is useful, in any environment, which requires a HTTP Proxy to communicate to the other endpoints. I built it locally, and it works for me.

Resolves #66

What do you think about it?

@jacob-keller

Copy link
Copy Markdown

Would this enable pipeline scripts to set the PROXY_HOST and PROXY_PORT environment variables and then perform access requests via the objects?

@luka5

luka5 commented Feb 5, 2021

Copy link
Copy Markdown
Author

We tested the PR with the PROXY_HOST and PROXY_PORT environment variable being defined on machine/container level. If you can manipulate the system environment variables via pipeline scripts, you might also be able to use them.

@aaronjwhiteside

Copy link
Copy Markdown

@mvigenin

Copy link
Copy Markdown

This improvement is very handy because it will allow us to choose how to configure the proxy settings.
Currently, the problem is that most of the plugins can use either the HTTP_PROXY or the Jenkin's proxy configuration.
There are use-cases where we don't wan't to use the Jenkin's proxy as it is taking precedence over the JAVA proxy settings. That can be an issue when using external build nodes (i.e. combination of fixed and on-demand nodes that may require different proxy settings).
Are there plans to merge this fix?

@jacob-keller

Copy link
Copy Markdown

This would be extremely helpful in systems with complex proxy settings and build nodes which each need different settings.

@bkholtzm

bkholtzm commented Apr 4, 2024

Copy link
Copy Markdown

I would also like to see this merged, I've tried the JVM workaround suggested in the original issue but, to no avail.

Mentioning the original author + some of the contributors from recent releases to see if we can get an update on this: @luka5 @gounthar @xocasdashdash @LeoQuote @aaronjwhiteside

Any help here would be greatly appreciated, thanks!

@savus3

savus3 commented May 23, 2024

Copy link
Copy Markdown

Hi all,
I have an error that this merge might fix:
May 23, 2024 2:45:54 PM SEVERE com.syhuang.hudson.plugins.listgitbranchesparameter.ListGitBranchesParameterDefinition generateContents org.eclipse.jgit.api.errors.TransportException: https://github.com/my_organization/myrepo.git: connection failed java.net.ConnectException: Connection timed out github.com

Does anyone have a hint how I can override/workaround this issue? I have the proxy configured in the global config of Jenkins.

Thanks in advance!

@savus3

savus3 commented May 24, 2024 •

Copy link
Copy Markdown

I managed to solve my issue by adding as option the proxy address to the command line that starts the Jenkis and works:

root@Master:~# grep OPTS /etc/systemd/system/jenkins.service.d/override.conf Environment="JAVA_OPTS=-Djava.awt.headless=true -Dhttps.proxyHost=my_proxy_ip -Dhttps.proxyPort=3128 -Dhttp.proxyHost=my_proxy_ip -Dhttp.proxyPort=3128" root@Master:~#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pipeline: GitHub plugin doesn't respect Jenkins update center proxy settings

6 participants