Hello Maryy
Thanks for joining the wolfSSL Forums.
I just ran the example locally and the Azure broker is responding:
eric@ubuntu:~/repos/wolfMQTT$ ./examples/azure/azureiothub
AzureIoTHub Client: QoS 1, Use TLS 1
MQTT Net Init: Success (0)
SharedAccessSignature sr=wolfMQTT.azure-devices.net%2fdevices%2fdemoDevice&sig=AJSJJtqi3z653SrfxhElRJzwxM2Mo5NFfIIF7smxxb4%3d&se=1664210350
MQTT Init: Success (0)
NetConnect: Host wolfMQTT.azure-devices.net, Port 8883, Timeout 5000 ms, Use TLS 1
MQTT TLS Setup (1)
MQTT TLS Verify Callback for azureiothub: PreVerify 0, Error -188 (certificate verify failed)
Subject's domain name is MSFT BALT RS256 CA
Allowing cert anyways
MQTT TLS Verify Callback for azureiothub: PreVerify 1, Error 0 (none)
Subject's domain name is *.azure-devices.net
MQTT Socket Connect: Success (0)
MQTT Connect: Proto (v3.1.1), Success (0)
MQTT Connect Ack: Return Code 0, Session Present 0
MQTT Subscribe: Success (0)
Topic devices/demoDevice/messages/devicebound/#, Qos 1, Return Code 1
MQTT Publish: Topic devices/demoDevice/messages/events/, Success (0)
MQTT Waiting for message...
^CReceived SIGINT
MQTT Message Wait: Error (Network) (-8)
MQTT Socket Disconnect: Success (0)
By default, the example overrides the CA verification. You can load the correct CA using the -A option when executing the example.
eric@ubuntu:~/repos/wolfMQTT$ wget https://cacerts.digicert.com/BaltimoreCyberTrustRoot.crt.pem -O examples/azure/balt.pem
eric@ubuntu:~/repos/wolfMQTT$ ./examples/azure/azureiothub -A examples/azure/balt.pem
AzureIoTHub Client: QoS 1, Use TLS 1
MQTT Net Init: Success (0)
SharedAccessSignature sr=wolfMQTT.azure-devices.net%2fdevices%2fdemoDevice&sig=J7LQ4exmfD6ol0%2funAcYVzkj7AH8F4pRrrjFxB8aDpY%3d&se=1664212327
MQTT Init: Success (0)
NetConnect: Host wolfMQTT.azure-devices.net, Port 8883, Timeout 5000 ms, Use TLS 1
MQTT TLS Setup (1)
MQTT TLS Verify Callback for azureiothub: PreVerify 1, Error 0 (none)
Subject's domain name is MSFT BALT RS256 CA
MQTT TLS Verify Callback for azureiothub: PreVerify 1, Error 0 (none)
Subject's domain name is *.azure-devices.net
MQTT Socket Connect: Success (0)
MQTT Connect: Proto (v3.1.1), Success (0)
MQTT Connect Ack: Return Code 0, Session Present 0
MQTT Subscribe: Success (0)
Topic devices/demoDevice/messages/devicebound/#, Qos 1, Return Code 1
MQTT Publish: Topic devices/demoDevice/messages/events/, Success (0)
MQTT Waiting for message...
^CReceived SIGINT
MQTT Message Wait: Error (Network) (-8)
MQTT Socket Disconnect: Success (0)