I’m using an HttpWebRequest object to access a web service via an HTTP POST. Part of the requirement is that I:
- Verify that the URL in the certificate matches the URL I’m posting to
- Verify that the certificate is valid and trusted
- Verify that the certificate has not expired
Does HttpWebRequest automatically handle that for me? I’d assume that if any of these conditions came up, I’d get the standard “could not establish trust relationship for the SSL/TLS secure channel” exception.
Yes, HttpWebRequest automatically handles these:
You have to use code like this if you want to disable this functionality.