aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

kpm restore certificate error on Windows (HelloMvc)

Open kscott5 opened this issue 11 years ago • 2 comments

I followed the instruction on Readme.md by executing kpm restore from the samples/HelloMvc directory but received the following error.

Restoring packages for G:\apps\kvm\Home\samples\HelloMvc\project.json
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Kestrel'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Hosting'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Mvc'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener'.
Warning: FindPackagesById: Microsoft.AspNet.Server.WebListener
  A certificate chain could not be built to a trusted root authority.

Warning: FindPackagesById: Microsoft.AspNet.Mvc
  A certificate chain could not be built to a trusted root authority.

Warning: FindPackagesById: Kestrel
  A certificate chain could not be built to a trusted root authority.

  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Kestrel'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Mvc'.
Warning: FindPackagesById: Microsoft.AspNet.Server.WebListener
  A certificate chain could not be built to a trusted root authority.

  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener'.
Warning: FindPackagesById: Microsoft.AspNet.Mvc
  A certificate chain could not be built to a trusted root authority.

  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Mvc'.
Warning: FindPackagesById: Kestrel
  A certificate chain could not be built to a trusted root authority.

  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Kestrel'.
Error: FindPackagesById: Microsoft.AspNet.Mvc
  A certificate chain could not be built to a trusted root authority.

----------
Error: FindPackagesById: Kestrel
  A certificate chain could not be built to a trusted root authority.

System.Security.Cryptography.CryptographicException: A certificate chain could not be built to a trusted root authority.

   at Microsoft.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
   at Microsoft.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
   at Microsoft.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Net.Http.Client.ManagedHandler.<ProcessRequestAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at Microsoft.Net.Http.Client.ManagedHandler.<SendAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.Restore.NuGet.HttpSource.<GetAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Framework.PackageManager.Restore.NuGet.PackageFeed.<FindPackagesByIdAsyncCore>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RemoteWalkProvider.<FindLibraryBySnapshot>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RemoteWalkProvider.<FindLibraryByVersion>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RestoreOperations.<FindLibraryByVersion>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Framework.PackageManager.RestoreOperations.<FindLibraryMatch>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RestoreOperations.<FindLibraryEntry>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RestoreOperations.<CreateGraphNode>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Framework.PackageManager.RestoreOperations.<CreateGraphNode>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Framework.PackageManager.RestoreCommand.<RestoreForProject>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at Microsoft.Framework.PackageManager.RestoreCommand.<ExecuteCommand>d__1.MoveNext()
----------
Restore failed
A certificate chain could not be built to a trusted root authority.

Error: FindPackagesById: Microsoft.AspNet.Server.WebListener
  A certificate chain could not be built to a trusted root authority.

kscott5 avatar Dec 11 '14 21:12 kscott5

This looks like the SSL cert validations fail for https://www.nuget.org/api/v2. Can you try accessing this url from browser and see if you notice any cert warnings in your browser as well?

Praburaj avatar Dec 29 '14 18:12 Praburaj

Beow is the web response to the URL you sent me.

This XML file does not appear to have any style information associated with it. The document tree is shown below. atom:titleDefault/atom:title atom:titlePackages/atom:title

FYI- i know it worked cause it pulled down packages unrelated to core clr such as xunit.core entity framework etc and then it didn't work. Also using a computer that's publicly available at library.

Sent from my T-Mobile 4G LTE Device

-------- Original message --------
From: Praburaj Thiagarajan [email protected]
Date:12/29/2014 11:16 AM (GMT-07:00)
To: aspnet/Home [email protected]
Cc: Karega Scott [email protected]
Subject: Re: [Home] kpm restore certificate error on Windows (HelloMvc) (#234)
This looks like the SSL cert validations fail for https://www.nuget.org/api/v2. Can you try accessing this url from browser and see if you notice any cert warnings in your browser as well?

— Reply to this email directly or view it on GitHub.

kscott5 avatar Dec 29 '14 21:12 kscott5