Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Because the CA certificate is NOT in the root certificate store, you will have within the <em>RemoteCertificateValidationCallback()</em> an error flag of <em>SslPolicyErrors.RemoteCertificateChainErrors</em> ; a possibility is to validate explicitely the certificate chain against your own <em>X509Certificate2Collection</em>, since you are not using the local store. </p> <pre><code>if (sslPolicyErrors == SslPolicyErrors.RemoteCertificateChainErrors) { X509Chain chain0 = new X509Chain(); chain0.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; // add all your extra certificate chain chain0.ChainPolicy.ExtraStore.Add(new X509Certificate2(PublicResource.my_ca)); chain0.ChainPolicy.VerificationFlags = X509VerificationFlags.AllowUnknownCertificateAuthority; isValid = chain0.Build((X509Certificate2)certificate); } </code></pre> <p>You can also re-use the chain passed in the callback, add your extra certificate(s) in the <em>ExtraStore</em> collection, and validate with the <em>AllowUnknownCertificateAuthority</em> flag which is needed since you add untrusted certificate(s) to the chain.</p> <p>You could also prevent the original error by adding programmatically the CA certificate in the trusted root store (of course it opens a popup, for it is a major security problem to globally add a new trusted CA root) :</p> <pre><code>var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); store.Open(OpenFlags.ReadWrite); X509Certificate2 ca_cert = new X509Certificate2(PublicResource.my_ca); store.Add(ca_cert); store.Close(); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload