Reputation: 29
First of all I want to tell that this question isn´t duplicate.
I want to install plugin in Jenkins. I went to Update Center but I can´t install anything because I have this error:
IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required".
Also when it comes to Java, I have Java for 64 bit.
I tried changing JRE folder and putting there things for JRE 64 bit because Jenkins installs 32bit but it doesn't work. How could I solve this problem?
Upvotes: 1
Views: 13515
Reputation: 86
java -Dhttp.proxyHost=THE_PROXY_HOST_NAME -Dhttp.proxyPort=PORT_NUMBER -Dhttp.proxyUser=USER_NAME -Dhttp.proxyPassword=MY_SUPER_SECRET_PASSWORD -Dhttp.auth.preference=basic -Djdk.http.auth.tunneling.disabledSchemes= -jar jenkins.war
Hopefully you've figured it out by now, but for those looking for an answer (myself in the near future)...
I did a lot of things and I'm not sure what really ended up working, but here's what I think worked for me and what I actually did.
Jenkins has known bugs with proxy settings from JENKINS-58567, JENKINS-56498, JENKINS-48775, etc. So here's what I think works:
Depending on how you're running Jenkins (i.e. running java -jar jenkins.war
or as a daemon systemctl start jenkins.service
) you're going to have to supply the proxy configuration as a Java option.
I'm running this as a daemon so I added my options in /etc/sysconfig/jenkins (I have no idea where this lives in Windows) under JENKINS_JAVA_OPTIONS and added the following java options:
-Dhttp.proxyHost=THE_PROXY_HOST_NAME -Dhttp.proxyPort=PORT_NUMBER -Dhttp.proxyUser=USER_NAME -Dhttp.proxyPassword=MY_SUPER_SECRET_PASSWORD -Dhttp.auth.preference=basic -Djdk.http.auth.tunneling.disabledSchemes=
I'm guessing that I can probably do -Djdk.http.auth.tunneling.disabledSchemes=Basic
instead of Dhttp.auth.preference=basic -Djdk.http.auth.tunneling.disabledSchemes=
based on this posted comment, but I'm lazy and don't feel like testing this out (I'll come back to refine this answer someday).
Apart from the aforementioned steps, I did some weird things (I was pretty desperate, I had gone 4 months without updating plugins).
export HTTP_PROXY=http://username:password@your-proxy-server:port
HTTP_PROXY
and value http://username:password@your-proxy-server:port
I can't remember what else I ended up doing, but I don't think they're important (since they didn't work).
Best of luck!
Upvotes: 7