Linux DNU还原失败,https获取超时

Linux DNU还原失败,https获取超时,linux,mono,asp.net-core,restore,dnu,Linux,Mono,Asp.net Core,Restore,Dnu,我在使用“dnu restore”还原nuget包时遇到一些问题 root@esomimx6s:~/TestASP5/src/TestASP5# dnu -v restore Could not determine OS version information. Defaulting to the empty string. Microsoft .NET Development Utility Mono-arm-1.0.0-rc1-16231 GET https://api.nuget.o

我在使用“dnu restore”还原nuget包时遇到一些问题

root@esomimx6s:~/TestASP5/src/TestASP5# dnu -v restore
Could not determine OS version information. Defaulting to the empty string.
Microsoft .NET Development Utility Mono-arm-1.0.0-rc1-16231

  GET https://api.nuget.org/v3/index.json
Restoring packages for /home/root/TestASP5/src/TestASP5/project.json
Attempting to resolve dependency TestASP5 >= 1.0.0
Attempting to resolve dependency Microsoft.AspNet.Server.Kestrel >= 1.0.0-rc1-final
  GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Server.Kestrel'
Attempting to resolve dependency TestASP5 >= 1.0.0
Attempting to resolve dependency Microsoft.AspNet.Server.Kestrel >= 1.0.0-rc1-final
Warning: FindPackagesById: Microsoft.AspNet.Server.Kestrel
  HTTP request timed out. Retrying.
  GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Server.Kestrel'
Warning: FindPackagesById: Microsoft.AspNet.Server.Kestrel
  HTTP request timed out. Retrying.
  GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Server.Kestrel'
Error: FindPackagesById: Microsoft.AspNet.Server.Kestrel
  HTTP request timed out. Exiting.
----------
System.Threading.Tasks.TaskCanceledException: A task was canceled.
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00078> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at System.Net.Http.HttpClientHandler+<SendAsync>c__async0.MoveNext () <0x7484c988 + 0x010af> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () <0x7414d6f0 + 0x0001b> in <filename unknown>:0
  at System.Net.Http.HttpClient+<SendAsyncWorker>c__async0.MoveNext () <0x74863400 + 0x00343> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.Restore.NuGet.HttpSource+<GetAsync>d__11.MoveNext () <0x748ef960 + 0x00813> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.Restore.NuGet.NuGetv2Feed+<FindPackagesByIdAsyncCore>d__25.MoveNext () <0x73e53e50 + 0x00617> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RemoteWalkProvider+<FindLibrary>d__6.MoveNext () <0x73e530c8 + 0x0018b> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreOperations+<FindLibrary>d__9.MoveNext () <0x73e6dae0 + 0x003eb> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreOperations+<FindLibraryByVersion>d__8.MoveNext () <0x73e6c908 + 0x007d3> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreOperations+<FindLibraryMatch>d__6.MoveNext () <0x73e60d38 + 0x00a57> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreOperations+<FindLibraryEntry>d__5.MoveNext () <0x741114b8 + 0x0029f> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreOperations+<CreateGraphNode>d__2.MoveNext () <0x7410fd28 + 0x0055f> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreOperations+<CreateGraphNode>d__2.MoveNext () <0x7410fd28 + 0x00adf> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreCommand+<CreateGraphNode>d__71.MoveNext () <0x7410f418 + 0x0015b> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreCommand+<RestoreForProject>d__69.MoveNext () <0x74133ad8 + 0x01b5f> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x73e40098 + 0x00017> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreCommand+<>c__DisplayClass68_0+<<Execute>b__2>d.MoveNext () <0x741331a8 + 0x001bb> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () <0x748f1698 + 0x00017> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreCommand+<Execute>d__68.MoveNext () <0x7498cde8 + 0x009bf> in <filename unknown>:0
----------
Restore failed
A task was canceled.

Feeds used:
    https://api.nuget.org/v3/index.json
当我查找nuget提要的IP地址时,它似乎没有被阻止:

root@esomimx6s:~/TestASP5/src/TestASP5# resolveip api.nuget.org
IP address of api.nuget.org is 68.232.34.200
root@esomimx6s:~/TestASP5/src/TestASP5# ping 68.232.34.200
PING 68.232.34.200 (68.232.34.200): 56 data bytes
64 bytes from 68.232.34.200: seq=0 ttl=53 time=28.921 ms
64 bytes from 68.232.34.200: seq=1 ttl=53 time=28.859 ms
^C
--- 68.232.34.200 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 28.859/28.890/28.921 ms

当我在BeagleBone Black(在同一个LAN中)上发出相同的命令时,一切都很顺利。我还可以尝试进一步调试出什么问题?

我找到了问题的解决方案。我知道HTTPS GET请求需要安装一些证书。但是因为错误没有说明身份验证是问题所在,所以我假设这不是问题所在。然而,这确实是我问题的根源

如果通过运行进行修复:

mono /usr/lib/mono/4.5/certmgr.exe -ssl -m https://go.microsoft.com
mono /usr/lib/mono/4.5/certmgr.exe -ssl -m https://nuget.org
mono /usr/lib/mono/4.5/certmgr.exe -ssl -m https://api.nuget.org
mono /usr/lib/mono/4.5/mozroots.exe --import --sync

与Fedora 23上描述的问题相同。错误消息确实具有误导性,使用mozroots运行同步可以修复此问题

mono /usr/lib/mono/4.5/mozroots.exe --import --sync
运行的输出是:

Importing certificates into user store...
140 new root certificates were added to your trust store.
Import process completed.
p/s:本可以将此作为评论,但我没有足够的声誉

Importing certificates into user store...
140 new root certificates were added to your trust store.
Import process completed.