Using https instead of http

  • Thread starter Thread starter saurabhaggarwal
  • Start date Start date
S

saurabhaggarwal

Hi

In my application the server url starts with https. ie it is using
secure connection. Now if we write server url in internet explorer
then http is automatically replaced by https.
But in dot net if I use https while creating HttpWebResponse object
then it gives me following exception

"The underlying connection was closed. Could not establish trust
relationship with remote server."

myHttpWebResponse =
dynamic_cast<HttpWebResponse*>(myHttpWebRequest->GetResponse());

help me please
 
saurabhaggarwal said:
Hi

In my application the server url starts with https. ie it is using
secure connection. Now if we write server url in internet explorer
then http is automatically replaced by https.
But in dot net if I use https while creating HttpWebResponse object
then it gives me following exception

"The underlying connection was closed. Could not establish trust
relationship with remote server."

myHttpWebResponse =
dynamic_cast<HttpWebResponse*>(myHttpWebRequest->GetResponse());

How come you post a C++ question in the C# group ;-)

If you receive this error, the BCL's default certificate policy
rejected the server certificate. See System.Net.ICertificatePolicy how
to implement your own, more lenient policy.


Cheers,
 
Back
Top