Skip to content
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

Proxy settings ignored for local connections #497

Closed
cavaliercoder opened this issue Dec 2, 2015 · 13 comments
Closed

Proxy settings ignored for local connections #497

cavaliercoder opened this issue Dec 2, 2015 · 13 comments

Comments

@cavaliercoder
Copy link

When connecting to https://chocolatey.org/api/v2/, the chocolatey client (v0.9.9.11) correctly uses the configured proxy server (configured via choco config set proxy). However, when connecting to nuget servers on my local LAN segment, the proxy settings are seemingly ignored and the client attempts to connect directly.

Often times a corporate proxy is still required to access a local web/NuGet server. Could you please consider making proxy bypass configurable?

The issue persists when using an IPv4 address, hostname or FQDN of a local NuGet host.

I've confirmed this issue in WireShark and Fiddler.

Running in PowerShell on Windows 10

Name                           Value
----                           -----
PSVersion                      5.0.10240.16384
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.42000
BuildVersion                   10.0.10240.16384
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3

May be related to #262

@ferventcoder
Copy link
Member

I think I might need a bit more information here. This is an explicit proxy you are setting correct?

@ferventcoder
Copy link
Member

Yah, I think #262 is related but in the opposite way. :)

@ferventcoder
Copy link
Member

This is strictly in getting the packages where it is is failing, correct?

@ferventcoder
Copy link
Member

That means I'll need to make adjustments in our fork of Nuget.Core.

@ferventcoder
Copy link
Member

If you specify an explicit proxy, we use it for getting software downloads from package instructions -

# check if a proxy is required
$explicitProxy = $env:chocolateyProxyLocation
$explicitProxyUser = $env:chocolateyProxyUser
$explicitProxyPassword = $env:chocolateyProxyPassword
if ($explicitProxy -ne $null) {
# explicit proxy
$proxy = New-Object System.Net.WebProxy($explicitProxy, $true)
if ($explicitProxyPassword -ne $null) {
$passwd = ConvertTo-SecureString $explicitProxyPassword -AsPlainText -Force
$proxy.Credentials = New-Object System.Management.Automation.PSCredential ($explicitProxyUser, $passwd)
}
Write-Host "Using explicit proxy server '$explicitProxy'."
$req.Proxy = $proxy
} elseif (!$webclient.Proxy.IsBypassed($url))
.

However Nuget.Core (which has the responsibility of getting packages themselves) is probably trying to decide if it should bypass a proxy. Incorrectly.

@cavaliercoder
Copy link
Author

I've tested choco search and choco install. Same result on both. End point URLs seem to be /Search() and /FindPackagesById(). Sounds like Nuget.Core to me.

I can't get much further on my home network to confirm if Get-WebFile.ps1 has the same issue for downloading the package content. I'll confirm tomorrow from the corp network.

Thanks.

@ferventcoder
Copy link
Member

I believe it likely doesn't have any issues because if a proxy is specified, it is not bypassed. But I agree an additional setting would be helpful

@ferventcoder ferventcoder modified the milestones: 0.9.10.1, 0.9.10 Mar 29, 2016
@ferventcoder ferventcoder modified the milestones: 0.9.10.1, 0.9.10.2, 0.9.10.3, 0.9.10.4, 0.9.10.5 Jun 17, 2016
@ferventcoder ferventcoder removed this from the 0.9.10.4 milestone Jun 24, 2016
@ferventcoder ferventcoder modified the milestones: 0.10.1, 0.10.2 Aug 15, 2016
@ferventcoder ferventcoder modified the milestones: 0.10.2, 0.10.3 Sep 20, 2016
@ferventcoder ferventcoder modified the milestones: 0.10.3, 0.10.4 Oct 3, 2016
@abmoham
Copy link

abmoham commented Jan 24, 2017

Voting this up to support issue #605

@ferventcoder ferventcoder self-assigned this Jan 24, 2017
@ferventcoder
Copy link
Member

Thanks @abmoham. We'll bump the priority for this.

@ferventcoder
Copy link
Member

Adding choco config set proxyBypassList for 0.10.4.

@ferventcoder
Copy link
Member

Rereading this issue - moved proxyBypassList to #1165.

@ferventcoder
Copy link
Member

I think this may actually be covered with #1165 as you will be able to specify the bypass list and whether to bypass on local or not.

@ferventcoder
Copy link
Member

Pretty sure this is covered by #1165. Closing as fixed for 0.10.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants