How to configure Chocolatey to use a corporate proxy?

I'm having trouble installing Chocolatey packages due to a corporate proxy. Internet Explorer is configured correctly, but I am having problems working with it through Powershell.

I can use the web client to load pages, for example. Microsoft.com, but Chocolatey ultimately doesn’t download packages asking for “Proxy Credentials”: ​​this will not be considered valid. Sometimes I just get the error message "Exception causes" DownloadFile "with arguments" 2 ":" The remote server responded with an error: (407) Proxy authentication required. "

I have two machines, one of which can download packages in order, and the other gives the errors above, but they both show direct access (as shown below):

PS C:\Windows\system32> netsh winhttp import proxy source=ie

Current WinHTTP proxy settings:

    Direct access (no proxy server).

PS C:\Windows\system32> netsh winhttp show proxy

Current WinHTTP proxy settings:

    Direct access (no proxy server).

I'm not too sure what is going on here. Any suggestions?

+4
source share
1 answer

Chocolatey has proxy instructions at https://github.com/chocolatey/choco/wiki/Proxy-Settings-for-Chocolatey and, in particular, the explicit proxy section . Make sure you have the correct version of choco installed to work. If this is not the case, we must correct the / choco documentation to make it correct.

For posterity:

Explicit proxy settings

Chocolatey , 0.9.9.9.

1 3 , Chocolatey -. -, -. proxyUser proxyPassword . / , .

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

0.9.9.9:

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

Source: https://habr.com/ru/post/1619838/


All Articles