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
dotnet restore fails behind proxy using windows authentication #6121
Comments
Got into the same problem, did you managed to solve? |
I'm currently using Fiddler as a local proxy using the "Automatically Authenticate" rule for our corporate proxy while the nuget config points to http://127.0.0.1:8888. Not very handy, but works as a temporary workaround. |
What worked for me was leaving the NuGet.Config in AppData intact after installation and checking the "Automatically Authenticate" option on Fiddler. |
I'm experiencing the same issue. Is it fair to assume (and plan for) this being something that would not be resolved until RTM? Does anybody know if this is an issue exclusively with windows, or impacts all platforms? |
This is pretty huge. I'm experiencing this as well. It's a complete blocker for us. |
I've tried setting proxy in nuget.config in AppData (proxy, user and pass) and it somehow ignores that, but not completely. If I set the proxy to nonsense URL it fails saying that the URL is wrong. If I provide a correct one it complains about auth (407). So it knows about the settings but somehow partially only. It's a showstopper in the corporate world... |
@veb82 I had a similar issue, if I set the proxxy on nuget.config in AppData instead of (407) I'd get a timeout. As I said before what worked for me was reverting the nuget.config to it's original state, downloading Fiddler and enabling the "Automatically Authenticate" option while I ran "dotnet restore". You can close Fiddler after that. |
Is this for real ? So basically I really should be considering this as a tool to use because I can't tell over DEV's that you need to install Fiddler and do this and that to get things working. Just going to have to stick with traditional ASP.Net MVC blank application and then will convert over to .Net core when they get their act together. I can't believe they just toss aside corporate developers like this, the completely stupid thing is I can actually use NPM, Bower et al because I have CNtlm configured but dotnet restore just doesn't work at all or have I missed something somewhere ? |
@Michael-D-Pine CNtlm instead of Fiddler should work too. It's basically the same problem NPM, Bower et al have... |
@axelheer I don't understand this, I have CNtlm installed and as far as I am aware working because I can use npm fine from a command line but this always fails, I don't think I have ever been able to get it work here are there environment variables or something else that needs to be set in a configuration file that will allow the dotnet restore command or other commands to work correctly ? cheers |
@Michael-D-Pine try setting the |
@axelheer Thanks for the info and updates we went and had a chat with our Operations guys and they have something setup that they put in our PC name and it basically enables us for anonymous authentication with the Proxy and this has worked for us here. But my CNtlm is still fine for npm but I will move away from that soon as I now don't have to worry about re-hasing my password on password changes. |
I am getting the same issue with NuGet under VS 2015, I've tried everything and no joy, any ideas? PATH=.\node_modules.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git |
Can someone of the donet cli team comment on this issue, please ? |
cc @emgarten |
I am pretty sure given my experience that CNTLM will not fix this issue as I stated I could not get that to solve my problem I had to get myself added on our internal group which basically allows anonymous proxy authentication which solves the problem. However maybe I was just missing some settings/configurations to Cntlm to solve the problem, i.e how to configure Visual Studio/dotnet restore to us Cntlm for proxy authentication. This is just oh so painful for something that should just work out of the box at least they gave us an error message this time. |
@brthor @Degrim, I'm wondering ... I got the issue too, and here is all I tried :) I've installed .Net Core RC 2 Preview One on top of Vs2015.2 I'm created a new Web>Asp.Net Core Web Application (.NET Framework) named "ReactDemo" When I try to Right click on the node "References> Restore packages" here is the full log :
When I try in the command prompt from one of these folders :
Then I went to nuget.org and downloaded "nuget.exe" (v3.4.x)
This is actually working ... That beeing said .. I tried it after removing : I've disabled the Offline nuget feed from nuget.config : I've also tried with AND WITHOUT nuget settings : HTTP_PROXY / HTTP_PROXY.USER / HTTP_PROXY.PASSWORD
NuGet Config files used: Feeds used: Installed: That beeing said how can dotnet restore fail on proxy when nuget restore works if quote : |
@brthor @Degrim Lots of company use NTLM proxy as you have seen from the HUGE number of people requesting (or going after auth & proxy) |
First off, thanks everyone for filing this bug! I want to clear up a couple things. The nuget.xplat client dotnet restore forwards to is not the same code as the nuget.exe which runs against the desktop .NET framework. This is likely the reason for the discrepancy you are seeing between the two.
Please move this issue to https://github.com/nuget/home as that is the only way this can be triaged by the appropriate team and then fixed. |
This issue is tracked for nuget here: NuGet/Home#2393 As @brthor mentions nuget.exe uses the desktop framework, dotnet.exe on the other hand targets .net core which does not contain the windows auth APIs that nuget.exe uses. |
I had a similar issue, inside our corporate network, NuGet was not able to restore packages and the error read: "Proxy Access Denied". I followed two different Posts on StackOverflow to fix this issue. First, you need to find the address of your proxy server: http://superuser.com/a/346376 And then you can download NuGet and configure it from the command line (http://stackoverflow.com/a/15463892/394348). This configuration worked for me: In my case I didn't need to set my password which is good. Hope this helps |
Thankyou @juanreyesv To reiterate the steps:
In my case, I'm using cntlm to interface with my proxy. |
I know this was closed and moved over to the NuGet project, but I'm not 100% convinced this isn't an issue with the Visual Studio's execution context of the dotnet restore command. What I'm seeing is that if I do a command line dotnet restore with the http_proxy environment variable set, it works no problem. Doing a restore from within Visual Studio (with the http_proxy environment variable set at the system level), it fails and I end up with a 407 proxy errors. What I find really bizarre, is that if I open a command prompt, run set http_proxy=[myproxyserver] and then do a command line dotnet restore, after this it appears that I can install packages normally through the visual studio nuget extension. As soon as I close the command prompt that I ran the dotnet restore from, any nuget installs from visual studio begin failing again. This makes no sense to me, as the environment contexts shouldn't be related, but it appears my understanding of ENV in windows isn't complete. You can see the same notes provided to the NuGet ticket here: |
Does it only shock me that i have to set a variable with the proxy and since it's an NTLM one the password and user are completely visible by any app ? |
@Barryrowe if relevent; I'm having an issue with the csharp extension for vscode; it seems to be trying to download its dependencies and failing.
both |
@juanreyesv => So we have to tell |
@tebeco Yes I think that's right.
Cheers |
@gafemoyano @axelheer @Michael-D-Pine
Setting usesystemdefault="false" fixed my issue. |
I still have issues with this and don't know whom to blame ;) What I've investigated so far: However, With I doublechecked if the config file is used by If I add So it seems that I see that edit |
@WolfgangKluge can you try the latest dotnet preview4 or preview5? I would still expect nuget.exe and dotnet to work the same even in this unique situation. If you are still seeing issues please open a new issue to track this. |
@emgarten thanks for replying. The latest I could find is preview 2.1 (https://www.microsoft.com/net/download/core#/current and https://github.com/dotnet/core/releases).
Ah, now I've found something https://github.com/dotnet/core/blob/master/release-notes/preview4-download.md btw: I don't get the version system.. (https://github.com/dotnet/cli/releases)
So the sequence is 2, 3, 2.1, 3, 2.1?? Edit: I still have to use Visual Studio 2015 in my company until the purchasing department decide to buy and distribute a new version - seems like this is not supported anymore. It's a mess that VS 2015 is no more than two years old and could not (and will not be able to) handle the new project file format Edit: But yes, this works now, I think (at least outside VS) |
It's correlated, but not the same cenario here, but I would like to document for those on Linux. I'm on Fedora 35 using VsCode and dotnet sdk 6 installed To use
|
Steps to reproduce
http_proxy
as described heredotnet new
dotnet restore
Actual behavior
Environment data
The text was updated successfully, but these errors were encountered: