473,804 Members | 3,162 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Webservice calls throwing exception with SecureChannelFa ilure status

Hello -

I'm trying to connect to a secure (HTTPS) webservice from a device running
..NET Compact Framework. I'm using the HttpWebRequest class. In cases where
the server is unavailable, unplugged for example, I find that this class
throws a webxception with status SecureChannelFa ilure. This is a problem,
because my application needs to distinguish between low-level network
problems and problems at the SSL/certificate level.

Possible solutions include:
1) Abandoning HttpWebRequest and working at the socket level (lots of work)
2) Trying to check the status of the server in some other way (eg. HTTP,
ping, etc)

Is there anything else I should be trying to make HttpWebRequest return a
more helpful exception status?

Thanks
Apr 4 '06 #1
2 5192
Simon,

I would think that a value of ConnectionFailu re would indicate that you
have a low-level network problem as opposed to a problem with the
certificate. I would think that a problem with the certificate would give
you a TrustFailure value in the WebException.

Also, have you checked the InnerException property on the WebException?
That could give you more information as well.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Simon Shearn" <si***@sgurr.th eredwire.co.uk> wrote in message
news:44******** **************@ news.gradwell.n et...
Hello -

I'm trying to connect to a secure (HTTPS) webservice from a device running
.NET Compact Framework. I'm using the HttpWebRequest class. In cases where
the server is unavailable, unplugged for example, I find that this class
throws a webxception with status SecureChannelFa ilure. This is a problem,
because my application needs to distinguish between low-level network
problems and problems at the SSL/certificate level.

Possible solutions include:
1) Abandoning HttpWebRequest and working at the socket level (lots of
work)
2) Trying to check the status of the server in some other way (eg. HTTP,
ping, etc)

Is there anything else I should be trying to make HttpWebRequest return a
more helpful exception status?

Thanks

Apr 4 '06 #2
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:e$******** ******@TK2MSFTN GP11.phx.gbl...
Simon,

I would think that a value of ConnectionFailu re would indicate that you have a low-level network problem as opposed to a problem with the
certificate. I would think that a problem with the certificate would give
you a TrustFailure value in the WebException.

Also, have you checked the InnerException property on the WebException? That could give you more information as well.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Simon Shearn" <si***@sgurr.th eredwire.co.uk> wrote in message
news:44******** **************@ news.gradwell.n et...
Hello -

I'm trying to connect to a secure (HTTPS) webservice from a device running .NET Compact Framework. I'm using the HttpWebRequest class. In cases where the server is unavailable, unplugged for example, I find that this class
throws a webxception with status SecureChannelFa ilure. This is a problem, because my application needs to distinguish between low-level network
problems and problems at the SSL/certificate level.

Possible solutions include:
1) Abandoning HttpWebRequest and working at the socket level (lots of
work)
2) Trying to check the status of the server in some other way (eg. HTTP,
ping, etc)

Is there anything else I should be trying to make HttpWebRequest return a more helpful exception status?

Thanks

Thanks for the reply. I'm not sure whether I've looked at the inner
exception or not, will check tomorrow. The webservice call works fine when
the server is available, so I'm taking that as an indication that the
certificate is OK.

Apr 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5072
by: Scott Brady Drummonds | last post by:
Hi, all, I've a fairly small piece of code that is causing me problems. I'm using std::string and am building a string of several dozen characters using several of std::string's functions: a blank constructor, operator=, and operator+=. This sequence of function calls causes a crash either at the call to operator+= or when the string object leaves scope (which must be the result of the destructor). Specifically, my Windows-based...
1
1670
by: Farooq Khan | last post by:
i'm writing a class library having following code snippet. i want this class to report an error (by throwing an Exception) to the application using this class library. the problem is that within that try block there are several exceptions that this class itself needs to handle (interrnally). now when the exception, UserAlreadyRegistered, is thrown the class' catch block (within library) catches it and no exception is thrown to the...
3
6893
by: Frank Schwarz | last post by:
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
40
13542
by: Kevin Yu | last post by:
is it a bad programming design to throw exception in the try block then catch it??
5
2011
by: KJ | last post by:
This is kind of hard to explain but I have a The controls are created with CreateChildControls(). Now let say I click a button and an error occurs in the control. If I throw it up it goes back to the web form. where do I catch the exception at? Example Webform Composite Control
10
5569
by: mttc | last post by:
I read articles that suggest preventing delete by throwing Exception from RowDeleting Event. I not understand where I can catch this Error?
0
1249
by: Andrew Teece | last post by:
HELP! I am calling a webservice as a result of an event in an infragistics control (well, various controls). Problem is that if a user clicks around the GUI alot, then my code crashes (because treeviews are cleared, etc).... If their clicks make the code work synchronously, evertything is fine, it would catch up with itself. The problem is that as soon as a webservice call is made, the system seems to perform a doevents, i say this...
40
36118
by: Sek | last post by:
Is it appropriate to throw exception from a constructor? Thats the only way i could think of to denote the failure of constructor, wherein i am invoking couple of other classes to initialise the object. TIA Sek
7
5150
by: Sek | last post by:
Hi Folks! I was pondering over a code and noticed that exception handlers were present in the private, protected as well as public methods. And, ofcourse, public methods were calling priv/prot methods internally. My thought was, the exception is being rethrown and propagated by the non-public methods to the public methods, causing performance overhead (stack winding etc). I do agree that, the purpose of throwing the exception by...
0
9707
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10586
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10323
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6856
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.