Mono problems with cert and mozroots

后端 未结 2 904
醉话见心
醉话见心 2021-02-14 01:11

I am using this command on my mono VM

sudo mozroots --import --sync

It appears to be getting the cert from this site.

I then try to co

相关标签:
2条回答
  • 2021-02-14 01:19
    1. A default installation of Mono doesn't trust anyone!
    2. mozroots will download and import trusted root certificates from Mozilla's LXR.
    3. Read the Mono Security FAQ

    EDIT:

    • Try the latest version of Mono packages from here
    • If that doesn't work either try the SVN trunk version here
    • From the Bug 606002, Gonzalo Paniagua Javier' suggested: "The way to go is to add your ServerCertificateValidationCallback to ServicePointManager and ignore errors with this code."
    • I have little experience in this area so I suggest to contact him for further assistance, maybe he can help. He's email is gonzalo@gonzalo.name (his blog)
    0 讨论(0)
  • 2021-02-14 01:35

    Follow-up about bug 606002 - here is the code to ignore said error code. Call it once in your initialization

                ServicePointManager.ServerCertificateValidationCallback += delegate(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors sslPolicyErrors) {
                if (sslPolicyErrors == SslPolicyErrors.RemoteCertificateChainErrors) {
                    foreach (X509ChainStatus status in chain.ChainStatus) {
                        if (status.Status != X509ChainStatusFlags.RevocationStatusUnknown) {
                            return false;
                        }
                    }
                    return true;
                }
    
                return false;
            };
    
    0 讨论(0)
提交回复
热议问题