Mono tlstest.exe error

6

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

Attempting to run the tests outlined here:

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

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

However, I downloaded tlstest.cs(see link above for source) and compiled it with:

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

This returned 3 warnings as follows:

tlstest.cs(169,23): warning CS0618: System.Net.ServicePointManager.CertificatePolicy' is obsolete:Use ServerCertificateValidationCallback instead'

tlstest.cs(210,26): warning CS0618: System.Net.Dns.Resolve(string)' is obsolete:Use GetHostEntry instead'

tlstest.cs(176,11): warning CS0219: The variable `prefix' is assigned but its value is never used

Compilation succeeded - 3 warning(s)

So now tlstest.exe has been created, so I ran:

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

Error #-2146762486: CERT_E_CHAINING 0x800B010A

c#
asp.net
https
mono
asked on Stack Overflow Dec 21, 2015 by Jonathan James

1 Answer

2

Had the same error "Error #-2146762486: CERT_E_CHAINING 0x800B010A". Followed the FAQ suggested by the link "mono-project.com/docs/faq/security" . Thanks to Jonathan James

Executed the command

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

Below results displayed:

Mozilla Roots Importer - version 5.14.0.0 Download and import trusted root certificates from Mozilla's MXR. Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.

WARNING: mozroots is deprecated, please move to cert-sync instead.

Downloading from 'https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt'... WARNING: Downloading the trusted certificate list couldn't be done securely (error: RemoteCertificateChainErrors)

continuing anyway.

If you're using mozroots to bootstrap Mono's trust store on a clean system this might be OK, otherwise it could indicate a network intrusion. Please ensure you're using a trusted network or move to cert-sync.

Importing certificates into machine store. 150 new root certificates were added to your trust store. Import process completed.

Then did the below steps again:

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

mono tlstest.exe https://www.nuget.org <--no error shown, only "https://www.nuget.org" is shown. Hope this helps...

answered on Stack Overflow Sep 3, 2018 by Itesh Simlai • edited Sep 3, 2018 by hotfix

User contributions licensed under CC BY-SA 3.0