Does HttpWebRequest automatically take care of certificate validation?

Posted by Kevin Pang on Stack Overflow See other posts from Stack Overflow or by Kevin Pang
Published on 2010-05-04T20:16:23Z Indexed on 2010/05/04 20:28 UTC
Read the original article Hit count: 201

Filed under:
|
|
|
|

I'm using an HttpWebRequest object to access a web service via an HTTP POST. Part of the requirement is that I:

  1. Verify that the URL in the certificate matches the URL I'm posting to
  2. Verify that the certificate is valid and trusted
  3. 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.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about certificate