473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

WebRequest fails with HTTPS Exception: SecureChannelFailure

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
3 6848
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Marcus | last post by:
Hi all, I have some code that downloads an XML tree from a web server. If there is a problem returning the requested XML tree from the server, it returns an XML tree with the error message in a...
5
by: mammothman42 | last post by:
Hi Sorry to be posting slabs of code, but i simply can't get this code to work. I continue to get error 405, method not allowed at req.GetRequestStream(). Can't for the life of me figure out...
2
by: Christian Pické | last post by:
Hi, I have to do a POST to an URI. I already figured out this code: WebRequest myRequest = WebRequest.Create("https://select.worldpay.com/wcc/purchase"); myRequest.Method = "POST";
2
by: Tony Guidici | last post by:
I have been attempting to send an XML post to a ASPX page I created as a listener. On our Windows Server 2003 Web Edition server, I installed a test certificate from Thawte and can hit the page...
2
by: oliver.wulff | last post by:
Hi My ASP.NET application has to send https requests to other web servers quite often. I'd like to know how I should manage the connections? Does the method WebRequest.Create() reuses an existing...
1
by: Nelson R. | last post by:
Hi, i need to get some info from a website page that requires an certificate. Ive got the provided certificate installed in IE, and when accessing the website page, it shows a window to...
4
by: Terry | last post by:
Hello, I am trying to get a response for an .aspx page in my current project (same virtual directory) by using WebRequest.GetResponse but I keep getting a exception with "500 Internal server...
0
by: jesper.hvid | last post by:
Hi. I've noticed, after moving some of our code to 2.0, that System.Net.WebRequest.Create(System.String) and System.Uri(System.String) no longer behave as they did in 1.1 framework. Example:...
3
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. I'm trying to create a call to a web page to validate and register software. The code I'm using is: Private Sub OK_Click(ByVal sender As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.