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

Webservice calls throwing exception with SecureChannelFailure status

P: n/a
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 SecureChannelFailure. 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
Share this Question
Share on Google+
2 Replies


P: n/a
Simon,

I would think that a value of ConnectionFailure 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.com

"Simon Shearn" <si***@sgurr.theredwire.co.uk> wrote in message
news:44**********************@news.gradwell.net...
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 SecureChannelFailure. 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

P: n/a
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:e$**************@TK2MSFTNGP11.phx.gbl...
Simon,

I would think that a value of ConnectionFailure 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.com

"Simon Shearn" <si***@sgurr.theredwire.co.uk> wrote in message
news:44**********************@news.gradwell.net...
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 SecureChannelFailure. 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 discussion thread is closed

Replies have been disabled for this discussion.