1

I am getting the following error when I try to load nget:

Unable to load the service index for source https://api.nuget.org/v3/index.json. The ServicePointManager does not support proxies with the https scheme.

Also, in Linqpad, I am getting a similar error:

ServicePointManager does not support proxies with the https scheme

Does anyone have any solutions for this? I found this post, but that solution, clearing the temp folders, did not fix my problem. Please help! Thanks!

Dan Csharpster
  • 2,662
  • 1
  • 26
  • 50
  • When you open the Package Manger Console, what Version does it say it's running? VS2017? – OzBob Aug 01 '17 at 07:13
  • Any more info in %appdata%\Microsoft\AppEnv\14.0\ActivityLog.xml – OzBob Aug 01 '17 at 07:19
  • Do you have proxy configured on your machine? Or "http_proxy" variable configured in environment variable? NuGet looks at those first if they exist. If those proxy environment variables begin with https, NuGet will fail. You can try to remove the proxy configured to check if it works fine.https://blogs.msdn.microsoft.com/jpsanders/2007/04/25/the-servicepointmanager-does-not-support-proxies-of-https-scheme-net-1-1-sp1/ or you can add proxy settings into Nuget.Config file, http://skolima.blogspot.sg/2012/07/nuget-proxy-settings.html. – Leo Liu Aug 01 '17 at 08:21
  • I was messing with fiddler, which injects itself as a proxy server, and I used the trick in the web.config where you can have fiddler intercept all of your app traffic while you're debugging locally in Visual Studio, like so: – Dan Csharpster Aug 01 '17 at 15:32
  • My working theory is that that even though I've commented that out and it was only for one app, maybe it permanently messed something up. – Dan Csharpster Aug 01 '17 at 15:33

3 Answers3

2

The ServicePointManager does not support proxies with the https scheme.

Since you have proxy configured in the web.config, you may need to pay attention to the syntax of proxy.

You will also get this error if you set something like this in your web.config file: proxyAddress="127.0.0.1:8888" You need list the scheme like this: proxyAddress="http://127.0.0.1:8888" (Add http://). The only scheme that is recognized by this class is http.

Besides, since you have proxy configured in you machine, NuGet will fail to access to the server. You should add proxy settings into Nuget.Config file, goto %AppData%\NuGet\NuGet.config, add below settings:

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

You can refer to the NuGet Proxy Settings for more detailed info.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • Thanks for the reply! I can do without fiddler intercepting my app's calls for now. I just want NuGet back. So I will gladly throw out the proxy server for now. I don't want to add more proxy settings. I'd like to just rip that all out and get NuGet working if possible. – Dan Csharpster Aug 02 '17 at 15:06
2

Found the problem! I basically just needed to remove the proxy setting from nuget and it looks like the command line was the best place for it. Thanks to @Leo-MSFT for the helpful suggestions.

Console output

Update: [8/8/2017] The problem has reemerged but this time, my fix won't save me since its still applied. I've checked all 3 spots for the nuget proxy settings and its still not working. I have no idea what's wrong now. Grrrr!!!!

Update: [8/8/2017, part deux] Found it! I had fiddler set in the machine.config as well, so make sure to check that if you are prone to forgetfulness like I am.

<system.net>
<!-- <defaultProxy
                enabled = "true"
                useDefaultCredentials = "true">
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>-->
</system.net>
Dan Csharpster
  • 2,662
  • 1
  • 26
  • 50
  • As a temporary workaround, I copied my solution's packages folder's contents to C:\packages, added that as a local feed and unchecked the main feed. Any additional packages I may want for now, I can go to nuget.org and download them by hand to C:\packages. It's not pretty but it allows me to keep moving while my requests for answers marinate for a bit. – Dan Csharpster Aug 08 '17 at 15:13
1

Fiddler was the culprit in my case too. I had to comment proxy settings from machine.config residing in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config.

<system.net>
<!-- <defaultProxy enabled="true" useDefaultCredentials="true">
    <proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false"/> 
</defaultProxy> -->
</system.net>
user1333222
  • 71
  • 1
  • 7