Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget behind Corporate proxy - External sources work, but internal does not

So in order to use NuGet and other dev tools working inside my organisation we've had to set a system wide environment variable 'http_proxy' for each user in our user specific Environment variables.

Now, this works for everything we've tried so far, all package managers like NuGet, NPM, chocolatey, all work fine with external repositories.

Recently we've tried to set up an internal NuGet server on our build server to internally host common packages. Everyone can browse to the URL where the server is located: -ip-/nuget and we can see the XML feed. The issue comes when we try to use nuget.exe, or Visual Studio 2017 for connecting to this source, the requests to find packages all time-out after 100000ms which i guess is the default timeout.

We can also browse exactly to the URL that times out out in any browser with no issue. I'm assuming that this is something to do with our internal proxy trying to route traffic out of the network when it is actually internal, but i have no way of verifying that.

Is there anything we can try to see if we can get this resolved?

like image 724
Lex Webb Avatar asked Oct 29 '22 01:10

Lex Webb


1 Answers

Is there anything we can try to see if we can get this resolved?

Since you can also browse exactly to the URL that times out out in any browser with no issue from your office system, there should be some internet limitations in your office environment. So I suggest you contact your office IT to confirm whether they add any limitations and whether used any proxy. If they are using some proxy, you need to set the proxy settings in NuGet.Config file which store in C:\Users\user name\AppData\Roaming\NuGet:

<configuration>

    <config>
        <add key="http_proxy" value="http://my.proxy.address:port" />
        <add key="http_proxy.user" value="mydomain\myUserName" />
        <add key="http_proxy.password" value="base64encodedHopefullyEncryptedPassword" />
    </config>

</configuration>

Refer to this link for details: NuGet Behind Proxy

like image 110
Leo Liu-MSFT Avatar answered Jan 02 '23 19:01

Leo Liu-MSFT