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.