BasicHttpBinding with Certificate authentication - error “forbidden”?

后端 未结 2 488
梦毁少年i
梦毁少年i 2021-01-05 06:18

I\'m trying go get WCF server and client mutually authenticate each other using SSL certificates on transport level using BasicHttpBinding. Here\'s how the server is getting

相关标签:
2条回答
  • 2021-01-05 07:03

    If you use standard generated proxy class you can to set transport client credential type to Certificate in App.Config:

    <binding name="SpoDataServiceSoap">
        <security mode="Transport">
            <transport clientCredentialType="Certificate"></transport>
        </security>
    </binding>
    

    C#

    var client = new MyServiceSoapClient()
    X509Certificate2 cert = CertificateHelper.GetClientCertificate();
    client.ClientCredentials.ClientCertificate.Certificate = cert;
    
    0 讨论(0)
  • 2021-01-05 07:13

    Try adding this in the client just after setting Security.Mode:

    binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
    
    0 讨论(0)
提交回复
热议问题