简体   繁体   中英

WCF client not ignoring certificate error (but works running Fiddler)

I have this line in my code (c# Net 4 client profile):

ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback(customXertificateValidation);

Which calls:

private static bool customXertificateValidation(object sender, X509Certificate cert, X509Chain chain, System.Net.Security.SslPolicyErrors error)
    {
        return true;
    }

To skip SSL certificate error, but I'm still getting the error of "cannot create SSL/TLS channel".

Also if I run Fiddler to check my traffic, it does connect to the service.

However on another solution (working with another server, this works perfectly) What should I check on my project config, or maybe my pc (windows 8.1 64 bits), or maybe something with Fiddler?

Thanks

Solved! Apparently this seemed to happened when calling the web service with the wrong type of header, misleading to an SSL error.

See this for a complete answer: WCF client security header error "An invalid security token was provided"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM