Hi guys,
I am trying to use makeWebRequest to access an endpoint using HTTPS but am receiving a 404 response when the "Use Device HTTPS requirements" option is enabled in the Connect IQ Device Simulator.
Project details:
Minimum SDK: 2.3.x
Type: 'watch-app' (I have also tried watchface)
Target device: Fenix 5
Permissions: Background and Communications
Eclipse run configuration: Fenix 5 / quatix 5.
I am wondering if the endpoint doesn't reach the requirement mentioned in the 'important updates' notes below as it's almost as if the request isn't attempted to the endpoint at all.
https://developer.garmin.com/index.php/blog/post/connect-iq-important-updates
If you’re developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible. In addition, your communication through higher-level APIs needs to be encrypted using TLS version 1.2 with forward secrecy. If you try to make a connection that doesn’t follow this requirement, an error is thrown. If your app needs to make a request to an insecure domain, you have to specify this domain in your app’s Info.plist file.
I cannot see an error being thrown apart from the 404 response so it is difficult to understand why this isn't working. If I disable the "Use Device HTTPS Requirements" option, the request is made successfully.
The endpoint I am trying to access is an Express Node.js application and I wondered if it was to do with the forward secrecy requirement:
https://certsimple.com/blog/a-plus-node-js-ssl#fixing-broken-perfect-forward-secrecy
The endpoint passes the tests performed by nscurl:
$ nscurl --ats-diagnostics https://XXXXXXXXXXXXXXX
Starting ATS Diagnostics
Configuring ATS Info.plist keys and displaying the result of HTTPS loads to https://XXXXXXXXXXXXXXX.
A test will "PASS" if URLSession:task:didCompleteWithError: returns a nil error.
Use '--verbose' to view the ATS dictionaries used and to display the error received in URLSession:task:didCompleteWithError:.
================================================================================
Default ATS Secure Connection
---
ATS Default Connection
Result : PASS
---
================================================================================
Allowing Arbitrary Loads
---
Allow All Loads
Result : PASS
---
================================================================================
Configuring TLS exceptions for XXXXXXXXXXXXXXX
---
TLSv1.2
Result : PASS
---
---
TLSv1.1
Result : PASS
---
---
TLSv1.0
Result : PASS
---
================================================================================
Configuring PFS exceptions for XXXXXXXXXXXXXXX
---
Disabling Perfect Forward Secrecy
Result : PASS
---
================================================================================
Configuring PFS exceptions and allowing insecure HTTP for XXXXXXXXXXXXXXX
---
Disabling Perfect Forward Secrecy and Allowing Insecure HTTP
Result : PASS
---
================================================================================
Configuring TLS exceptions with PFS disabled for XXXXXXXXXXXXXXX
---
TLSv1.2 with PFS disabled
Result : PASS
---
---
TLSv1.1 with PFS disabled
Result : PASS
---
---
TLSv1.0 with PFS disabled
Result : PASS
---
================================================================================
Configuring TLS exceptions with PFS disabled and insecure HTTP allowed for XXXXXXXXXXXXXXX
---
TLSv1.2 with PFS disabled and insecure HTTP allowed
Result : PASS
---
---
TLSv1.1 with PFS disabled and insecure HTTP allowed
Result : PASS
---
---
TLSv1.0 with PFS disabled and insecure HTTP allowed
Result : PASS
---
================================================================================
I also tried testing with an example endpoint from https://requestb.in/ and had the same problem. Does anyone have any example endpoints that can be called successfully by the Fenix 5 emulator with "Use Device HTTPS Requirements" enabled?
Also, does anyone have the exact specification that an endpoint is required to meet in order to be accessed using makeWebRequest from a Fenix 5?
Any other thoughts as to what could resolve this would be gratefully received.
Many thanks,
Will