2

This might seem to be a similar issue but on CentOS. I have already tried all the solution on this as well as on other threads, however I still get the below error

/usr/share/dotnet/sdk/3.1.201/NuGet.targets(124,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/Build/_Base/Main/Main.csproj]
/usr/share/dotnet/sdk/3.1.201/NuGet.targets(124,5): error :   Response status code does not indicate success: 407 (Proxy Authentication Required). [/Build/_Base/Main/Main.csproj]

Our corporate Proxy have authentication enabled. With env HTTP_PROXY HTTPS_PROXY set to HTTPS_PROXY=http://user:pass@proxy.mycomp.com:8080 Wget works fine for https://api.nuget.org/v3/index.json So obviously our proxy have internet access.

Created a Nuget.Config with below entry

 <?xml version="1.0" encoding="utf-8"?>
   <configuration>
   </configuration>


nuget config -Set http_proxy="http://proxy.mycomp.com:8080" -Set https_proxy="http://proxy.mycomp.com:8080"  -Set http_proxy.user="user" -Set https_proxy.user="user" -Set http_proxy.password="pass" -Set https_proxy.password="pass"  -ConfigFile Nuget.Config

Final config looks like this

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="http_proxy" value="http://proxy.mycomp.com:8080" />
    <add key="https_proxy" value="http://proxy.mycomp.com:8080" />
    <add key="http_proxy.user" value="user" />
    <add key="https_proxy.user" value="user" />
    <add key="https_proxy.password" value="pass" />
    <add key="http_proxy.password" value="encryptedpass" />
  </config>

Even with all this dotnet build fails with the first mentioned error for proxy authentication.

Same result with both dotnet-sdk-2.2-2.2.402-1.x86_64 & dotnet-sdk-3.1-3.1.201-1.x86_64

According to this I tried on both $HOME/.config/NuGet/NuGet.Config & $HOME/.nuget/NuGet/NuGet.Config

Edit: Missed one point, The error wrt proxy authentication required happens when setting

export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0

When unsetting this with

unset DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER

Results in this

/usr/share/dotnet/sdk/2.2.402/NuGet.targets(123,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/Build/_Base/Main/Main.csproj]
/usr/share/dotnet/sdk/2.2.402/NuGet.targets(123,5): error :   GSSAPI operation failed with error - Unspecified GSS failure.  Minor code may provide more information (SPNEGO cannot find mechanisms to negotiate). [/Build/_Base/Main/Main.csproj]

Documentation of Dotnet Linux packages seems to be inadequate, any help is really appreciated.

user2700022
  • 489
  • 3
  • 19
  • Do you've found a solution for this issue? – CrazyTea Nov 30 '21 at 18:41
  • No, this requirement was no longer needed hence dropped it. But I was unable to solve it back then. Please add a comment here if you find the solution. – user2700022 Dec 01 '21 at 18:42
  • See the answer in my own question: https://stackoverflow.com/questions/70174731/how-to-restore-nuget-packages-in-a-docker-container-using-a-proxy It was an issue with our proxy. – CrazyTea Dec 02 '21 at 13:25

0 Answers0