Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mosquitto_sub does not present client certificate #3026

Open
Erikvv opened this issue Mar 29, 2024 · 1 comment
Open

mosquitto_sub does not present client certificate #3026

Erikvv opened this issue Mar 29, 2024 · 1 comment

Comments

@Erikvv
Copy link

Erikvv commented Mar 29, 2024

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
@MichaelSteurer
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants