简体   繁体   English

詹金斯:IOException:无法通过代理隧道。 代理返回“需要HTTP / 1.1 407代理身份验证”

[英]Jenkins: IOException: Unable to tunnel through proxy. Proxy returns “HTTP/1.1 407 Proxy Authentication Required”

First of all I want to tell that this question isn´t duplicate . 首先,我想说这个问题不是重复的

I want to install plugin in Jenkins. 我想在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. 另外,对于Java,我有64位的Java。

I tried changing JRE folder and putting there things for JRE 64 bit because Jenkins installs 32bit but it doesn't work. 我尝试更改JRE文件夹,并为JRE 64位放置东西,因为Jenkins安装了32位,但是它不起作用。 How could I solve this problem? 我该如何解决这个问题?

TL;DR TL; DR

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. 我做了很多事情,我不确定什么最终能奏效,但这就是我认为对我有用的,以及我实际上所做的。

What I think works 我认为有效

Jenkins has known bugs with proxy settings from JENKINS-58567 , JENKINS-56498 , JENKINS-48775 , etc. So here's what I think works: 詹金斯(Jenkins)从JENKINS-58567JENKINS-56498JENKINS-48775等代理设置中已知错误。因此,我认为这是可行的:

Set Java proxy settings 设置Java代理设置

Depending on how you're running Jenkins (ie 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. 根据您运行Jenkins的方式(即运行java -jar jenkins.war或作为守护程序systemctl start jenkins.service ),您将必须提供代理配置作为Java选项。

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: 我跑这是一个守护进程,所以我说我的选择在/ etc / SYSCONFIG /詹金斯 (我不知道这个地方居住在Windows)JENKINS_JAVA_OPTIONS下,并添加以下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=

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). 我猜想我可以根据此发布的注释执行-Djdk.http.auth.tunneling.disabledSchemes=Basic而不是Dhttp.auth.preference=basic -Djdk.http.auth.tunneling.disabledSchemes= ,但是我是太懒了,不想测试这个问题(有一天我会回来完善这个答案)。

What I actually did 我实际上做了什么

Apart from the aforementioned steps, I did some weird things (I was pretty desperate, I had gone 4 months without updating plugins). 除了上述步骤之外,我还做了一些奇怪的事情(我非常绝望,我已经4个月没有更新插件了)。

  • Added an export command to my startup script in /etc/rc.d/init.d/jenkins /etc/rc.d/init.d/jenkins中的启动脚本中添加了导出命令
    • export HTTP_PROXY=http://username:password@your-proxy-server:port
  • Added a global variable on Jenkins > Manage Jenkins > Configure System > Global Properties > Checkbox Environment Variable > Add a variable name HTTP_PROXY and value http://username:password@your-proxy-server:port 在Jenkins>管理Jenkins>配置系统>全局属性>复选框环境变量上添加了全局变量>添加变量名HTTP_PROXY和值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! 祝你好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法通过代理建立隧道。 代理返回“需要 HTTP/1.1 407 代理授权” - Unable to tunnel through proxy. Proxy returns “HTTP/1.1 407 Proxy Authorization Required” 无法通过代理建立隧道。 代理通过 https 返回“HTTP/1.1 407” - Unable to tunnel through proxy. Proxy returns “HTTP/1.1 407” via https 如何修复 java.io.IOException:无法通过代理建立隧道。 代理返回“HTTP/1.1 400 错误请求”? - How to fix java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 400 Bad Request"? 无法通过代理进行隧道传输。 代理返回 HTTP/1.1 503 服务不可用 - Unable to tunnel through proxy. Proxy returns HTTP/1.1 503 Service Unavailable 无法通过代理建立隧道。 代理返回“HTTP/1.1 403 Forbidden - Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Forbidden 407无法通过代理隧道 - 407 unable to tunnel through proxy 需要HTTP错误407代理身份验证 - HTTP Error 407 Proxy authentication required HTTPS URL的基本代理身份验证返回HTTP / 1.0 407需要代理身份验证 - Basic proxy authentication for HTTPS URLs returns HTTP/1.0 407 Proxy Authentication Required 需要HTTP 407代理身份验证:如何用Java代码处理 - http 407 proxy authentication required : how to handle in java code Jenkins代理407错误 - Jenkins proxy 407 error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM