How can WCF client detect that server requires security certificate? The detection should happen at runtime.
How can WCF client detect that server requires security certificate? The detection should happen
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The first thing that I have in mind to resolve such issue it will be to connect to that server and call a method or something like that. Put the server call in a try-catch block and read the message at runtime.
For example, I tried this in a application of mine which connected with a server with security certificates, deleting the part for certificates in my clients. I had an error like this:
The client certificate is not provided. Specify a client certificate in ClientCredentials.So if this Exception is caught, you can detect at runtime that the server requires security certificate.
There may be more Exception messages for this problem. Also, I don’t know if it is the best way. But it should work.