WCF per connection server certificate validation

前端 未结 7 2754
清歌不尽
清歌不尽 2021-02-20 13:50

I\'m trying to bypass https certificate validation only to our own testing environment (multiple machines), while trying to keep certificate validation for all the other connect

7条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-20 14:01

    You actually can disable SSL cert validation per client/channel with this code:

    var noCertValidationAuth = new X509ServiceCertificateAuthentication() 
    { 
        CertificateValidationMode = X509CertificateValidationMode.None 
    };
    client.ClientCredentials.ServiceCertificate.SslCertificateAuthentication = noCertValidationAuth;
    

    It is actually a variation of answer in this thread, so kudos there.

提交回复
热议问题