Jenkins代理407错误 [英] Jenkins proxy 407 error

查看:369
本文介绍了Jenkins代理407错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用代理服务器进行互联网访问的公司网络中运行 Jenkins CI .

I'm running Jenkins CI inside a corporate network which uses a proxy for internet access.

我尝试在 Plugins-> Advanced 中配置代理详细信息,但是即使凭据正确(是的,我检查了很多次),它也无法验证测试URL" http://google.com 并返回

I tried to configure proxy details in Plugins->Advanced, but even though the credentials are correct (yeah, I checked it a bunch of times), it cannot validate "Test URL" even on http://google.com and returns

无法连接到 http://google.com (代码407).

Failed to connect to http://google.com (code 407).

奇怪的是,Jenkins仍然能够自己下载插件(哇!),但是完全无法连接到任何HTTP资源.控制台输出的消息是:

Strangely, Jenkins is still able to download plugins itself (whoa!), but totally unable to connect to any HTTP resource. The message that outputs from the console is:

←[0mApr 16,2015 1:58:56 PM org.apache.commons.httpclient.HttpMethodDirector专业 cessProxyAuthChallenge信息:使用NTLM @ proxyrye.asg.com进行身份验证失败:2015年4月16日下午2:09:09 org.apache.commons.httpclient.HttpMethodDirector执行WithRetry INFO:处理时捕获到I/O异常(java.net.ConnectException) 请求:连接超时:连接2015年4月16日下午2:09:09 org.apache.commons.httpclient.HttpMethodDirector执行WithRetry INFO:重试请求2015年4月16日下午2:09:10 org.apache.commons.httpclient.auth.AuthChallengeProcesso r selectAuthScheme信息:选择了ntlm身份验证方案←[31mApr 2015年16月2日下午09:09:10 org.apache.commons.httpclient.HttpMethodDirector 严重:凭据不能用于NTLM 身份验证:org.apache.commons.h ttpclient.UsernamePasswordCredentials org.apache.commons.httpclient.auth.InvalidCredentialsException: 凭据不能用于NTLM身份验证: org.apache.commons.httpclient.UsernamePasswo rdCredentials 在org.apache.commons.httpclient.auth.NTLMScheme.authenticate(NTLMScheme .java:332)

←[0mApr 16, 2015 1:58:56 PM org.apache.commons.httpclient.HttpMethodDirector pro cessProxyAuthChallenge INFO: Failure authenticating with NTLM @proxyrye.asg.com:80 Apr 16, 2015 2:09:09 PM org.apache.commons.httpclient.HttpMethodDirector execute WithRetry INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect Apr 16, 2015 2:09:09 PM org.apache.commons.httpclient.HttpMethodDirector execute WithRetry INFO: Retrying request Apr 16, 2015 2:09:10 PM org.apache.commons.httpclient.auth.AuthChallengeProcesso r selectAuthScheme INFO: ntlm authentication scheme selected ←[31mApr 16, 2015 2:09:10 PM org.apache.commons.httpclient.HttpMethodDirector au thenticate SEVERE: Credentials cannot be used for NTLM authentication: org.apache.commons.h ttpclient.UsernamePasswordCredentials org.apache.commons.httpclient.auth.InvalidCredentialsException: Credentials cann ot be used for NTLM authentication: org.apache.commons.httpclient.UsernamePasswo rdCredentials at org.apache.commons.httpclient.auth.NTLMScheme.authenticate(NTLMScheme .java:332)

推荐答案

我们的Jenkins在我们公司的代理之后一直存在很长一段时间.前几天,他们更改了我们代理希望的身份验证方案的顺序.这是我们詹金斯停止连接互联网的一天.

We had this issue a rather long time with our Jenkins behind our company's proxy. The other day they changed the order of authentication schemes our proxy desires. This was the day our Jenkins stopped connecting to the internet.

显然 Jenkins无法通过需要NTML身份验证的代理进行连接.这就是导致我对Jenkins进行改进以扩展代理配置屏幕的原因.在开发扩展程序的过程中,我发现Jenkins并未利用所有与代理相关的系统属性,因此无法与NTLM一起使用.

Obviously Jenkins is not able to connect via a proxy that requires NTML authentication. This was what lead me to issue an improvement for Jenkins to extend the proxy configuration screen. During the work on the extension I discovered that Jenkins does not make use of all proxy related system properties, therefore it cannot work with NTLM.

因此,仅允许 NTLM身份验证的代理的答案是:它无法通过Jenkins UI起作用.

As such the answer for a proxy that allows only NTLM authentication is: it will not work via the Jenkins UI.

但是,如果您的代理允许其他身份验证方案,则可以按照我们的解决方法进行操作,这很简单:将Java系统属性-Dhttp.auth.preference="basic"添加到Jenkins启动脚本或该容器中的一个.

But if your proxy allows other authentication schemes, you can follow our workaround, it is rather simple: add the java system property -Dhttp.auth.preference="basic" to your Jenkins startup script or to that one of your container.

这将强制Jenkins利用基础库和Java机制使用基本身份验证而非NTLM连接到您的代理.

This will force the underlying libraries and Java mechanisms Jenkins makes use of to connect to your proxy using basic authentication, not NTLM.

这篇关于Jenkins代理407错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆