Why don’t we get WebExceptionStatus.NameResolutionFailure?

0 votes
asked Sep 25 by mobile653 (320 points)

Our .NET CF 3.5 application connects to different endpoints/URLs using Rebex HTTPS in the latest version 2019R3.

When the Internet connection is not established, we get the following WebException:

System.Net.WebException: Error while processing request. --->
vsdb: Error while processing request. --->
Rebex.Net.ProxySocketException: Unable to resolve hostname. --->
System.Net.Sockets.SocketException: Der angegebene Host ist unbekannt
at System.Net.Dns.ResolveInternal(String hostName)
at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
at vsdh.lkaw(String dt)
at mgvc.ahoo(String gg, Int32 gh, ProxySocketExceptionStatus gi)
at mgve.wtep(EndPoint awi)
at Rebex.Net.ProxySocket.Connect(EndPoint remoteEP)
at Rebex.Net.ProxySocket.Connect(String serverName, Int32 serverPort)
at mguh.idbx(String bci, Int32 bcj, Boolean bck)
at vscy.fjbv()
at vscy.fjbz(Boolean aj)
at vscy.fjcb()
at Rebex.Net.HttpRequest.lrbj()
at Rebex.Net.HttpRequest.lrbi()
at Rebex.Net.HttpRequest.lrbh()
at Rebex.Net.HttpRequest.GetResponse()
at [Our Code]

We would expect WebExceptionStatus.NameResolutionFailure as the value of WebException.Status, because of the Rebex.Net.ProxySocketException: Unable to resolve hostname in the stack (see above).

What I get is WebExceptionStatus.SendFailure as the WebException.Status, which I assume to be a bug.

1 Answer

0 votes
answered Sep 26 by Lukas Pokorny (103,170 points)

I confirm this is a bug. Thanks for reporting it and sorry for inconvenience! We will fix it in the next release.

If you would like to get a hotfix when it's available, please let us know.

commented Sep 27 by mobile653 (320 points)
moved Oct 14 by mobile653

Thank you for the fast response.

Perhaps there is another related bug, when all available network adapters are disabled or disconnected.

With the Windows-integrated HTTP library, we get a WebException with the Status WebExceptionStatus.ConnectFailure and the following stack:

System.Net.WebException: Network is unreachable.
at System.Net.HttpWebRequest.finishGetResponse()
at System.Net.HttpWebRequest.GetResponse()
at [Our Code]

With the Rebex HTTPS library, we get a WebException with the status WebExceptionStatus.SendFailure and the following stack:

System.Net.WebException: Error while processing request. ---> vsdb: Error while processing request. ---> Rebex.Net.ProxySocketException: Unable to resolve hostname. ---> System.Net.Sockets.SocketException: Could not resolve host
at System.Net.Dns.ResolveInternal(String hostName)
at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
at vsdh.lkaw(String dt)
at mgvc.ahoo(String gg, Int32 gh, ProxySocketExceptionStatus gi)
at mgve.wtep(EndPoint awi)
at Rebex.Net.ProxySocket.Connect(EndPoint remoteEP)
at Rebex.Net.ProxySocket.Connect(String serverName, Int32 serverPort)
at mguh.idbx(String bci, Int32 bcj, Boolean bck)
at vscy.fjbv()
at vscy.fjbz(Boolean aj)
at vscy.fjcb()
at Rebex.Net.HttpRequest.lrbj()
at Rebex.Net.HttpRequest.lrbi()
at Rebex.Net.HttpRequest.lrbh()
at Rebex.Net.HttpRequest.GetResponse()
at [Our Code]

The Rebex-internal Rebex.Net.ProxySocketException points to a problem resolving the hostname, but there is obviously no one who could resolve it.

We would expect WebExceptionStatus.ConnectFailure as the value of WebException.Status when there is no network adapter or IP configuration available.

We would expect WebExceptionStatus.NameResolutionFailure as the value of WebException.Status when there is no DNS server in the IP configuration or the configured DNS server does not answer or the DNS server cannot resolve the hostname.

We would expect WebExceptionStatus.SendFailure as the value of WebException.Status when there is a problem sending POST data to the host.

We would expect WebExceptionStatus.ReceiveFailure as the value of WebException.Status when there is a problem receiving data from the host.

commented Oct 15 by Lukas Pokorny (103,170 points)
We also noticed these discrepancies when fixing the issue with NameResolutionFailure and they should be fixed in the next release (and the hotfix) as well.
commented Oct 22 by mobile653 (320 points)
Very good! Which of the WebExceptionStatus values can we expect from the new library version?
commented Oct 22 by Lukas Pokorny (103,170 points)
These might occur: NameResolutionFailure, ConnectFailure, ReceiveFailure, SendFailure, RequestCanceled, ProtocolError, ConnectionClosed, TrustFailure, SecureChannelFailure, ServerProtocolViolation, Timeout, ProxyNameResolutionFailure, UnknownError.
...