Note that there are some explanatory texts on larger screens.

plurals
  1. POC# client authenticate 2 Certificates?
    text
    copied!<p>I live in Israel , Google also has <code>google.co.il</code>.</p> <p>I created a webrequest to <strong>google.com</strong> ( And I want to connect <em>only</em> to google.com !)</p> <p>But in the <code>ServerCertificateValidationCallback</code> function , it seems I'm getting <em>2</em> certificates .</p> <p>Here is the code : </p> <pre><code>ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, policyError) =&gt; { var subject = ((X509Certificate2)certificate).GetName(); Console.WriteLine(subject); // return true; return XXX==YYY; // ????the 2'nd question is about this line }; WebRequest oRequest; WebResponse oResponse; oRequest = WebRequest.Create("https://www.google.com/"); oResponse = oRequest.GetResponse(); </code></pre> <p>the result for the code (when <code>return true</code> ) is <em>enabled</em> is : </p> <pre><code>C=US, S=California, L=Mountain View, O=Google Inc, CN=www.google.com C=US, S=California, L=Mountain View, O=Google Inc, CN=*.google.co.il </code></pre> <p>But Im facing a problem : </p> <p>Now that it emits 2 certificates :</p> <ol> <li><p>Why do I get 2 certifictes ? </p></li> <li><p>which value should be in "<code>XXX</code>" and which value whould be in "<code>YYY</code>" ?</p> <p>( I mean , should I equate <code>CN</code> or <code>O</code> or <em>_</em>_ to the corresponding Google's value ?</p> <p>and what if I get (firstly) the google.com certificate (which is the desired) , and later I get the google.co.il certificate ( which is <em>not</em> desired) ? </p></li> </ol>
 

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