Mono tlstest.exe错误

问题描述 投票:6回答:1

Setting up Mono for ASP.net app dev on a MacBook Pro El Capitan 10.11.12 i5: tlstest.cs compiles with 3 warnings, and tlstest.exe compiles with 1 error

试图运行此处概述的测​​试:

http://www.mono-project.com/docs/getting-started/mono-basics/

mono hello.exe //runs fine with no errors and prints "Hello Mono World"

但是,我下载了tlstest.cs(参见上面的链接获取源代码)并编译它:

mcs tlstest.cs /r:System.dll /r:Mono.Security.dll 

这返回了3个警告如下:

tlstest.cs(169,23):警告CS0618:System.Net.ServicePointManager.CertificatePolicy' is obsolete:使用ServerCertificateValidationCallback而不是'

tlstest.cs(210,26):警告CS0618:System.Net.Dns.Resolve(string)' is obsolete:使用GetHostEntry代替'

tlstest.cs(176,11):警告CS0219:分配了变量`prefix',但从未使用过它的值

编译成功 - 3次警告

所以现在已经创建了tlstest.exe,所以我跑了:

mono tlstest.exe https://www.nuget.org //which returned an error:

错误#-2146762486:CERT_E_CHAINING 0x800B010A

c# asp.net https mono
1个回答
2
投票

有相同的错误“错误#-2146762486:CERT_E_CHAINING 0x800B010A”。按照链接“mono-project.com/docs/faq/security”建议的常见问题解答。感谢Jonathan James

执行命令

"mozroots --import --ask-remove --machine"

显示以下结果:

Mozilla Roots Importer - 版本5.14.0.0从Mozilla的MXR下载并导入受信任的根证书。版权所有2002,2003 Motus Technologies。版权所有2004-2008 Novell。 BSD许可。

警告:不推荐使用mozroots,请转到cert-sync。

从'https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt'下载...警告:无法安全地下载可信证书列表(错误:RemoteCertificateChainErrors)

无论如何继续。

如果您使用mozroots在干净的系统上引导Mono的信任存储,这可能没问题,否则可能表明存在网络入侵。请确保您使用的是受信任的网络或转移到证书同步。

将证书导入机器商店。您的信任库中添加了150个新的根证书。导入过程已完成。

然后又做了以下步骤:

csc tlstest.cs -r:System.dll <-- 2 warning as before

mono tlstest.exe https://www.nuget.org https://www.nuget.org“显示。希望这有助于......

© www.soinside.com 2019 - 2024. All rights reserved.