Using HTTPS and httpWebRequest Using HTTPS and httpWebRequest asp.net asp.net

Using HTTPS and httpWebRequest


Simply swapping http with https is fine enough while using HttpWebRequest. It requires no special handling for https requests.


Changing the URL to https should be enough provided that there are no issues with the certificate.

SSL will check for 3 things when it comes to certificates:

  1. The cert was issued to the URI that you are hitting
  2. The cert is not expired
  3. The cert was issued by a trusted authority (e.g.: Verisign)

Of these criteria, #3 is the most commonly failed check. You can programatically ignore any or all of these errors (at your own risk). Here is an example on how to do that.

That said, if this is for the Paypal api, you should not have any certificate errors.


Work with https if you use method SetCookies(Uri, string) of CookieContainer class server will reject your request!To use cookie after login you must use single cookie object!