Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF custom certificate validation with BasicHttpBinding
    primarykey
    data
    text
    <p>I have a WCF application hosted on IIS 6 that needs to </p> <ol> <li>Have 2-way SSL authentication</li> <li>Validate client certificate content with some client host information</li> <li>Validate client certificate is issued by the valid subCA.</li> </ol> <p>I was able to do 1) successfully. I am trying to achieve 2) and 3) by following <a href="https://stackoverflow.com/questions/1559915/custom-certificate-validation-in-wcf-service">this</a> - basically creating a class that inherits X509CertificateValidator and overriding the Validate method with my own validation implementation(step 2 and 3). I followed the MSDN instructions exactly however, it seem that the Validate method is not being called. I purposely throw a SecurityAccessDeniedException in the overidden Validate method and no exception is thrown when I tried to access the service via my browser. I can still access my website with any client certificate.</p> <p>I also read <a href="https://stackoverflow.com/questions/1559915/custom-certificate-validation-in-wcf-service">this thread</a> but it didn't really help. Any help would be greatly appreciated!</p> <p>Here's my configuration:</p> <pre><code>&lt;system.serviceModel&gt; &lt;services&gt; &lt;service behaviorConfiguration="SimpleServiceBehavior" name="SampleNameSpace.SampleClass"&gt; &lt;endpoint address="" binding="basicHttpBinding" bindingConfiguration="NewBinding0" contract="SampleNameSpace.ISampleClass" /&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="SimpleServiceBehavior"&gt; &lt;serviceMetadata httpsGetEnabled="true" policyVersion="Default" /&gt; &lt;serviceCredentials&gt; &lt;clientCertificate&gt; &lt;authentication certificateValidationMode="Custom" customCertificateValidatorType="SampleNameSpace.MyX509CertificateValidator, SampleAssembly"/&gt; &lt;/clientCertificate&gt; &lt;/serviceCredentials&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;bindings&gt; &lt;basicHttpBinding&gt; &lt;binding name="NewBinding0"&gt; &lt;security mode="Transport"&gt; &lt;transport clientCredentialType="Certificate" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/basicHttpBinding&gt; &lt;/bindings&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    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.
 

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