0
votes

I have a simple javascript class which creates/deletes devices inside an Azure IoT Hub, using the azure-iothub Node.js module.

class AzureManager {
    constructor(options) {
      const { connectionString } = options;
      this.registry = iothub.Registry.fromConnectionString(connectionString);
    }

   /**
    * Gets some stats about the Iot Hub selected
    * @returns {Object} an object with the following properties:
    * totalDeviceCount, enabledDeviceCount, disabledDeviceCount
    */
   getStats() {
      return new Promise((resolve, reject) => {
          this.registry.getRegistryStatistics((err, stats, res) => {
              if (err) {
                  return reject(err);
              }

              return resolve(stats);
          });
      });
   }
}

I have developed a Jest test for this class and when I execute it, all tests pass without problems. When I execute the code inside Chrome, I get the following error.

request.js:150 OPTIONS https://pysensors.azure-devices.net/statistics/devices?api-version=2018-06-30 net::ERR_SPDY_INADEQUATE_TRANSPORT_SECURITY

I don't know if I have to configure something to make it works on all the recent versions of the browsers. I've found this forum post (somehow similar to this blog post) which talks about a cipher suite problem on the server side and to force the client to use HTTP1/1, but since I'm using the SDK, I have no control on how the request is performed. Thanks

EDIT: Just discovered that the module I'm using is intended to be used just server side. Using Firefox I don't have the SPDY issue, anyway I get CORS issues since the Azure doesn't support it. I've read somewhere that it's on their roadmap, but not a top priority.

1

1 Answers

0
votes

Official Microsoft's response:

This happens to be a bug on IoTHub service side. IoTHub service does not support HTTP/2 protocol yet but due to the bug, we do return HTTP/2 as a supported protocol in ALPN extension during initial handshake. We are going to fix this bug soon but until then, you can configure your client to always use HTTP/1 protocol which is supported and works well.

Please vote for this feature on Azure IoT Feedback channel so that we can prioritize it. Thanks!

HTTP 2.0 support

https://feedback.azure.com/forums/321918-azure-iot/suggestions/9958737-http-2-0-support

Details: https://social.msdn.microsoft.com/Forums/azure/en-US/0cf59124-f8f0-4fb2-ba20-5666894341cb/errspdyinadequatetransportsecurity-error-on-rest-api-call-in-chrome?forum=azureiothub