By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,424 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,424 IT Pros & Developers. It's quick & easy.

WebRequest fails with HTTPS Exception: SecureChannelFailure

P: n/a
Hello,

we are implemting an application that uses a https
connection
for accessing a website. It is also possible to connect
via http.

With http every thing works fine. With https it is not
possible
to connect to the web site. The tunnel is established
without
an error, but it seems that the Credentials are ignored,
because
the server generates a not authorised error. The following
peace
of code is used for the connection.
webreq = (HttpWebRequest)WebRequest.Create(sendstr);
webreq.Timeout = m_SocketTimeout;
webreq.Credentials = m_Credentials;
webreq.CookieContainer = new CookieContainer();
webreq.CookieContainer.Add(m_CookieCol);

webresp = (HttpWebResponse)webreq.GetResponse();
getstream = webresp.GetResponseStream();
sr = new StreamReader(getstream);
rc = sr.ReadToEnd();

If the above code is used via https the WebResponse
generates the
exception SecureChannelFailure.

Any help is wecome.

Thanks

Frank.
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Frank,

This is just a guess, but is it possible that you don't have the root
certificates on the machine updated?

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Frank Schwarz" <an*******@discussions.microsoft.com> wrote in message
news:5d****************************@phx.gbl...
Hello,

we are implemting an application that uses a https
connection
for accessing a website. It is also possible to connect
via http.

With http every thing works fine. With https it is not
possible
to connect to the web site. The tunnel is established
without
an error, but it seems that the Credentials are ignored,
because
the server generates a not authorised error. The following
peace
of code is used for the connection.
webreq = (HttpWebRequest)WebRequest.Create(sendstr);
webreq.Timeout = m_SocketTimeout;
webreq.Credentials = m_Credentials;
webreq.CookieContainer = new CookieContainer();
webreq.CookieContainer.Add(m_CookieCol);

webresp = (HttpWebResponse)webreq.GetResponse();
getstream = webresp.GetResponseStream();
sr = new StreamReader(getstream);
rc = sr.ReadToEnd();

If the above code is used via https the WebResponse
generates the
exception SecureChannelFailure.

Any help is wecome.

Thanks

Frank.

Nov 16 '05 #2

P: n/a
Nicholas Paldino [.NET/C# MVP] wrote:
Frank,

This is just a guess, but is it possible that you don't have the
root certificates on the machine updated?


Or maybe there's something wrong with the certificate and it is being
rejected by the BCL's default certificate policy?

--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 16 '05 #3

P: n/a
Nicholas,

thanks for your reply.

I do not think that it is a problem with the certificate, because it is
possible
to access areas where no additional login is necessary. Only areas with an
additional username password access are rejected. The username and password
are copied using the Credentials. As it worked with Http, I think the
Credentials
might be ignored or not correcly sended.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Frank,

This is just a guess, but is it possible that you don't have the root
certificates on the machine updated?

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Frank Schwarz" <an*******@discussions.microsoft.com> wrote in message
news:5d****************************@phx.gbl...
Hello,

we are implemting an application that uses a https
connection
for accessing a website. It is also possible to connect
via http.

With http every thing works fine. With https it is not
possible
to connect to the web site. The tunnel is established
without
an error, but it seems that the Credentials are ignored,
because
the server generates a not authorised error. The following
peace
of code is used for the connection.
webreq = (HttpWebRequest)WebRequest.Create(sendstr);
webreq.Timeout = m_SocketTimeout;
webreq.Credentials = m_Credentials;
webreq.CookieContainer = new CookieContainer();
webreq.CookieContainer.Add(m_CookieCol);

webresp = (HttpWebResponse)webreq.GetResponse();
getstream = webresp.GetResponseStream();
sr = new StreamReader(getstream);
rc = sr.ReadToEnd();

If the above code is used via https the WebResponse
generates the
exception SecureChannelFailure.

Any help is wecome.

Thanks

Frank.


Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.