加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows – 如何配置Chocolatey以使用公司代理?

发布时间:2020-12-14 04:25:42 所属栏目:Windows 来源:网络整理
导读:我在公司代理服务器后面安装Chocolatey软件包时遇到问题. Internet Explorer已正确配置,但我在使用Power shell时遇到问题. 我可以使用Web客户端下载页面,例如Microsoft.com,但最终Chocolatey无法下载包含提示“请提供代理凭据:”的包,该提示不接受我的域登
我在公司代理服务器后面安装Chocolatey软件包时遇到问题. Internet Explorer已正确配置,但我在使用Power shell时遇到问题.

我可以使用Web客户端下载页面,例如Microsoft.com,但最终Chocolatey无法下载包含提示“请提供代理凭据:”的包,该提示不接受我的域登录有效.有时我只是得到错误“异常调用”DownloadFile“with”2“参数:”远程服务器返回错误:(407)需要代理验证.“

我有两台机器,其中一台可以很好地下载软件包,另一台机器上面给出了错误,但它们都显示直接访问(如下所示):

PS C:Windowssystem32> netsh winhttp import proxy source=ie

Current WinHTTP proxy settings:

    Direct access (no proxy server).

PS C:Windowssystem32> netsh winhttp show proxy

Current WinHTTP proxy settings:

    Direct access (no proxy server).

我不太清楚这里发生了什么.有什么建议?

解决方法

Chocolatey在 https://github.com/chocolatey/choco/wiki/Proxy-Settings-for-Chocolatey处有代理指令,特别是关于显式代理的部分.确保安装了正确版本的choco以使其正常工作.如果这不正确,我们应该修复文档/ choco以使其正确.

后人:

Explicit Proxy Settings

Chocolatey has explicit proxy support starting with 0.9.9.9.

You can simply configure 1 or 3 settings and Chocolatey will use a
proxy server. proxy is required and is the location and port of the
proxy server. proxyUser and proxyPassword are optional. The values for
user/password are only used for credentials when both are present.

choco config set proxy <locationandport>
choco config set proxyUser <username>
choco config set proxyPassword <passwordThatGetsEncryptedInFile>

Example

Running the following commands in 0.9.9.9:

choco config set proxy http://localhost:8888
choco config set proxyUser bob
choco config set proxyPassword 123Sup#rSecur3

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读