0

I'm porting a vb.net HTTPS client application on WinCE60 CF35: bsically it needs to send HTTPS REST requests to a server.

I started development on a Win10 desktop and there I have no problems (VS2015 - NET35).

When I run on WinCE I receive an exception when I send the webrequest: the system says that it does not have the error message, but I see the status = 10 = SecureChannelFailure.

The code is the following:

Private Function SendGetRequest(cmd As String) As Boolean

    Dim request As WebRequest = WebRequest.Create(m_baseUrl + cmd)

    request.Method = "GET"
    request.Timeout = m_timeout
    request.Headers.Add("Authorization", "Basic " + m_authInfo)
    '
    Dim dataStream As Stream
    '
    Try
        Dim response As WebResponse = request.GetResponse()
        m_statusCode = CType(response, HttpWebResponse).StatusCode

        dataStream = response.GetResponseStream()
        ...

On the server side I don't receive anything. So, I tryed to sniff using Wireshark and I see the following:

Sniff In my understanding the client (.113) sends a RESET, but I don't know why ..

PS: if I build a HTTP request I receive response.

SteMMo
  • 392
  • 1
  • 4
  • 23
  • I substituted the standard calls with the ones by Rebex. This library can generate a log where I found: 2017-07-14 16:27:44 INFO HttpRequest(1)[89589158] TLS: Certificate verification status: RootNotTrusted, CnNotMatch (32) – SteMMo Jul 14 '17 at 16:57
  • For the moment I solved with the Rebex lib adding to my source code the line: client.Settings.SslAcceptAllCertificates = True Now I'd like to understand if the problem on CF35 was on TLS version, SHA version or whatever .. – SteMMo Jul 18 '17 at 10:09

1 Answers1

1

Multiple potential issues here:

  • Based on the error message, the most likely problem: The CE device may be missing a root certificate, or the root certificate may be expired or revoked, and therefore Windows CE is unable to verify the server certificate. If your CE device has a UI, open the Certificates applet in the Control Panel to verify that the required root certificate is installed and valid
  • .NET CF does not support SHA-2 based certificates (see answers here). Mentioning this because it's the next problem you are likely to run into, once the root cert is in place
  • Windows CE often sends RST to close TCP connections. Not pretty, but probably unrelated to the HTTPS problem you're seeing (as far as I understand the rationale is this is faster than having both sides send FIN/ACK)
Carsten Hansen
  • 1,508
  • 2
  • 21
  • 27