0

I've got a small edge module, written in python using the azure-iot-sdk-python, that sends events back to the IoT hub using Mqtt. This works nicely.

The events are no longer delivered when I switch to using Mqtt over websockets (IoTHubTransportProvider.MQTT_WS).

In the edgeHub logs i can see: 2018-06-14 07:33:33.599 +00:00 [ERR] [Microsoft.AspNetCore.Server.Kestrel] - Uncaught exception from the OnConnectionAsync method of an IConnectionAdapter. System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> Interop+OpenSsl+SslException: SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL. ---> Interop+Crypto+OpenSslCryptographicException: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol

When I manually update the injected EdgeHubConnectionString (export EdgeHubConnectionString=...) to the one taken from the Device Details page on the IoT hub blade in the Azure portal, then Mqtt over websockets starts working.

How can I get Mqtt over websockets working with the injected EdgeHubConnectionString module connection string, instead of the one take from the Device Details page?

  • Use this command `docker exec edgeAgent printenv` I can see there is a environment variable named "DeviceConnectionString", its value is same with the one from Device Details of Azure Portal. So where you get the EdgeHubConnectionString and what's its format looks like? – Rita Han Jun 15 '18 at 07:23
  • Why do you need to change the communication between your module and the Edge Hub to MQTT over Websockets in the first place? – silent Jun 15 '18 at 09:45
  • @RitaHan-MSFT `DeviceConnectionString` is not available in an edge module. you can verify this by doing `docker exec printenv`. The connection string that needs to be used is the `EdgeHubConnectionString`. See e.g. also https://github.com/Azure/iot-edge/blob/master/v2/samples/azureiotedge-simulated-temperature-sensor/Program.cs#L37 – Hartmut Behrens Jun 15 '18 at 11:54
  • @silent The edge module will be deployed behind a firewall, where port 443 is one of the only options available to get traffic to/from the cloud. – Hartmut Behrens Jun 15 '18 at 11:56
  • 1
    @HartmutBehrens I'm not sure if there might be a misunderstanding. Edge modules do not talk to the IoT Hub in Azure in any way. They only communicate with the Edge Hub (running in another Docker container). Only the Edge hub communicates with the Azure IoT Hub – silent Jun 15 '18 at 12:27
  • @silent D'oh - thank you ! You're right, I did misunderstand that part. – Hartmut Behrens Jun 15 '18 at 12:51
  • Future readers, please see @silent comment - that is the answer to the question. – Hartmut Behrens Jun 15 '18 at 13:19

0 Answers0