mosquitto_sub does not present client certificate
Erikvv opened this issue · comments
Erik van Velzen commented
I connect to Azure Event Grid with mosquitto_sub. The --cert and --key arguments are ignored. I conclude this because:
- There is no error when I specify invalid files
- Azure logging says "Peer did not present client certificate for authentication".
When I use a different client such as paho-mqtt it does work.
Docker compose file:
services:
mosquitto_sub:
image: eclipse-mosquitto:2.0.18
entrypoint: mosquitto_sub
volumes:
- ./cert:/cert
command: >
--debug
--host lessgrid.francecentral-1.ts.eventgrid.azure.net
--port 8883
--id mosquitto_sub
--cert /cert/mosquitto_sub.crt
--key /cert/mosquitto_sub.key
--topic moment
--protocol-version 5
Command output:
$ docker compose run mosquitto_sub
Client mosquitto_sub sending CONNECT
Client mosquitto_sub received CONNACK (135)
Connection error: Not authorized
Client mosquitto_sub sending DISCONNECT
Michael Steurer commented
I followed the Quickstart and then managed to publish with this command:
mosquitto_pub \
-i client1 -u client1 \
--cafile intermediate_ca.crt \
--cert client1-authn-ID.pem \
--key client1-authn-ID.key \
--tls-use-os-certs \
-h my.eventgrid.azure.net -p 8883 \
-t my/topic -m "my_message" \
-d