New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
choco proxy support #243
Comments
Yes. Have the same issue. Would be great is environment variables are supported. Many thanks. |
Thanks for creating this with things that can be done to fix this as well! |
Found more information on this. Has to do with the config needing not to be blank. We'll likely need to override the defaults, which don't find the chocolatey.config and don't find the nuget.config unless it exists (but that is not an optimal way to go about it). For now a workaround is to create the Nuget.Config file like before with the right settings, see https://docs.nuget.org/consume/nuget-config-file for location and reference. |
This is issue chocolatey-archive/chocolatey#404 from the old repo. |
There also seems to be a problem even if the proxy is configured in IE. I have the proxy set up in IE and have it set in the environment variables http_proxy and https_proxy. I installed choco by manually downloading and then running the installer in powershell. But when I try to intstall
The proxy requires username and password authentication. Before I had set up the http_proxy and https_proxy variables choco asked me for proxy credentials, but not the address. It also seems to have verified those credentials, as when I tried it with false credentials I got an error. Still, even then it trew the 407 error. |
Thanks for the information. I may have something for testing over the next couple of weeks if you are interested. This one is a bit harder for me as I don't have a proxy myself. I know that nuget.core will accept those proxy credentials in the config, which I think we need to ensure the download will also look at those values. |
Sure, I can help you test. |
Happy to test as well when a fix is available |
Hi, I can help test this when the fix is ready. The nuget config workaround doesn't seem to work so unfortunately we can't use chocolatey at the moment :-( Thanks Dan |
@ifunky You can use 0.9.8.x series. You may also want to try to set a file next to choco.exe named choco.exe.config with the xml configuration settings in it (untested). Create a file at <?xml version="1.0"?>
<configuration>
<appSettings />
<system.net>
<defaultProxy>
<proxy proxyaddress="<proxyserver>" />
</defaultProxy>
</system.net>
</configuration> |
Thanks for the quick response - the choco.exe.config didn't work but putting the proxy settings as above in machine.config did the trick! Cheers |
@ifunky What do you mean by machine.config? |
@GuillaumeBonamy the one for .net framework. Only do that if you want it to affect ALL .net applications. |
NuGet originally set the ProxyCache internal which did not make it a good candidate to use to set a custom proxy. Update NuGet.Core to one that will allow that (our internal chocolatey-nuget)
NuGet originally set the ProxyCache internal which did not make it a good candidate to use to set a custom proxy. Update NuGet.Core to one that will allow that (our internal chocolatey-nuget). Add a method for adding an override proxy server that will force NuGet to use the override proxy if it exists.
- Add proxy configuration settings (`proxy`, `proxyUser`, `proxyPassword`), ensuring that proxyPassword is encrypted. - Ensure the proxy is configured with Nuget Core for downloading the package. - Pass proxy environment variables to PowerShell service. - Get-WebHeaders and Get-WebFile look at an explicitly specified proxy before falling back to a system proxy and then falling back to no proxy.
This is pretty much complete. Take a look at https://github.com/chocolatey/choco/wiki/Proxy-Settings-for-Chocolatey#explicit-proxy-settings for information on how to set this up once 0.9.9.9 rolls out the door. |
- Add proxy configuration settings (`proxy`, `proxyUser`, `proxyPassword`), ensuring that proxyPassword is encrypted. - Ensure the proxy is configured with Nuget Core for downloading the package. - Pass proxy environment variables to PowerShell service. - Get-WebHeaders and Get-WebFile look at an explicitly specified proxy before falling back to a system proxy and then falling back to no proxy.
* stable: (chocolateyGH-405) Cache downloads by name and version (chocolateyGH-243) Add Proxy Support (chocolateyGH-243) Ensure NuGet Proxy Override
Merged into stable at bfa8ccf - will be released in 0.9.9.9. |
thanks a lot @ferventcoder |
I'm using chocolatey in automated builds to install some stuff and the http_proxy and https_proxy environment variables do not work in 0.9.9.
The documentation https://github.com/chocolatey/choco/wiki/Proxy-Settings-for-Chocolatey appears to be wrong.
I have solved this by adding
to chocolatey.config and also updating Get-WebFile.ps1 & Get-WebHeaders.ps1 in /helpers/functions to setup the proxy even if
$webclient.Proxy.IsBypassed($url)
returns trueWould be nice if the environment variables where supported again.
The text was updated successfully, but these errors were encountered: