Superman
Superman

Reputation: 3784

NuGet VS 2012 ServicePointManager does not support proxies with the https scheme

I have recently upgraded from VS2012 RC to RTM, and since the upgrade to RTM, I can no longer access nuget. I receive the following error in the Manage NuGet Packages window.

The ServicePointManager does not support proxies with the https scheme.

I looked at the solution offered here in a previous stack overflow question, but it does not apply to me as I am not behind a firewall (certainly not supposed to be and verified by http://whatismyipaddress.com/proxy-check). I can also see the RSS feeds / VS can access other network resources, which in the previous question the problem was related to all VS internet traffic not just NuGet as it is in my case.

Any ideas what could have caused this, or how to restore access to NuGet? I have tried this on my machines at work, and my personal computer at home, all with the same effect.

Upvotes: 29

Views: 42538

Answers (10)

ddagsan
ddagsan

Reputation: 1826

I had same error on visual studio 2022. I had also vs2019 but this error. As a solution, I edited devenv.exe.config (not devenv.exe) file. Detailed explanation is in that blog.

  1. Go to this folder path directly and find devenv.exe file, open with admin privilege's.

    C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE

  2. In devenv.exe file Scroll down to bottom line and locate section <system.net>.

  3. Now, replace <system.net> section with below section and save. enter image description here

    • Before:
    <system.net>
      <settings>
        <ipv6 enabled="true"/>
      </settings>   
    </system.net>
    
    • After:
    <system.net>
      <defaultProxy>
        <proxy usesystemdefault="False" />
      </defaultProxy>   
    </system.net>
    
  4. Re - Open Visual Studio Projects.

Upvotes: 3

Johan Franz&#233;n
Johan Franz&#233;n

Reputation: 2424

I got this just by having Fiddler installed. I tried starting it and quitting to be sure it wasn't running but still couldn't get Nuget to work. There must be some other hooks left.

Upvotes: 1

Coder22
Coder22

Reputation: 109

NuGet VS 2015 ServicePointManager does not support proxies with the https scheme

Problem was not with proxy because the proxy was removed in my case. Therefore the visual studio config file had to be changed. But in other cases the answer can also lie in changing the config file to your situation.

Go to: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE

find the config file devenv.exe.config and edit in administrator mode:

        <defaultProxy enabled="false" useDefaultCredentials="true">  
            <proxy bypassonlocal="True" proxyaddress="http://proxy.somesite.nl" />  
        </defaultProxy> 

setting enabled="false" or adapt the section to your needs.

Restart VS after changes.

Upvotes: 1

Dinesh Falwadiya
Dinesh Falwadiya

Reputation: 809

I also faced the same issue for that I just closed my fiddler and restarted Visual Studio to solve the problem

Upvotes: 5

Thomas
Thomas

Reputation: 2458

I started getting this in VS2015 on one of my machines. I had an additional package feed on myget which constantly asked me for credentials and failed even when entering correct credentials. What helped me was clearing the nuget cache and config by deleting these two nuget folders:

  • %APPDATA%\NuGet
  • %LOCALAPPDATA%\NuGet

After that I restarted Visual Studio and added my custom package source again.

Upvotes: 13

Teoman shipahi
Teoman shipahi

Reputation: 23062

I am not sure what happened in my nuget usage history but I end up stuck using proxy for my development machine. to make it work.

1- open fiddler

2- goto %AppData%\NuGet\NuGet.config

Package sources

<packageSources>
    <add key="nuget http" value="http://www.nuget.org/api/v2/" />
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</packageSources>

3- config

<config>
    <add key="HTTP_PROXY" value="http://127.0.0.1:8888" />
  </config>

4- profit.

Upvotes: 7

Kit
Kit

Reputation: 2136

A very late answer, but I've been getting the exact same message when restoring Nuget packages in VS 2015. It seems that last time I restarted my machine I didn't stop Fiddler, and Fiddler seems to have left something in a funny state. When I started and exited from Fiddler the issue went away.

Upvotes: 4

wisbucky
wisbucky

Reputation: 37907

Check your system environment variables for http_proxy and https_proxy. NuGet looks at those first if they exist. If those proxy environment variables begin with https, NuGet will fail. Fix them and restart your computer (restarting Visual Studio did not work for me).

You can verify this by opening the Package Manager Console:

Get-Childitem env:http_proxy
Get-Childitem env:https_proxy

If you want to quickly get it working without restarting your computer, manually set the proxies in the Package Manager Console:

$env:http_proxy = "http://your.proxy.com:1234"
$env:https_proxy = "http://your.proxy.com:1234"

Upvotes: 3

Wilkoteq
Wilkoteq

Reputation: 101

This also happens if you have a proxy setup in your internet settings.

Upvotes: 8

Dave Swersky
Dave Swersky

Reputation: 34810

The solution is in this answer:

Visual Studio 2010 nuget error: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel

The problem is related to a bad SSL cert on the default Nuget package source.

Upvotes: 11

Related Questions