Skip to content

TLS issues with mosquitto-2.0.18 #692

@tka85

Description

@tka85

I have seen this issue but setting the value of tls_version in mqttwarn.ini, doesn't solve it.

Both mosquitto and mqttwarn are in single docker-compose.yaml. Using mqttwarn-full:latest image.

For both ini values tls_version = 'tlsv1_1' and tls_version = 'tlsv1_2', the compose logs are the same:

mosquitto  | 2024-02-08T13:35:14: mosquitto version 2.0.18 running
mqttwarn   | 2024-02-08 13:35:15,659 INFO     [mqttwarn.commands         ] Starting mqttwarn
mqttwarn   | 2024-02-08 13:35:15,660 INFO     [mqttwarn.commands         ] Log level is DEBUG
mqttwarn   | 2024-02-08 13:35:15,660 DEBUG    [mqttwarn.core             ] Trying to load built-in service "file" from "file"
mqttwarn   | 2024-02-08 13:35:15,664 DEBUG    [mqttwarn.core             ] Trying to load service "file" from file "/usr/local/lib/python3.11/site-packages/mqttwarn/services/file.py"
mqttwarn   | 2024-02-08 13:35:15,665 INFO     [mqttwarn.core             ] Successfully loaded service "file"
mqttwarn   | 2024-02-08 13:35:15,666 DEBUG    [mqttwarn.core             ] Trying to load built-in service "log" from "log"
mqttwarn   | 2024-02-08 13:35:15,666 DEBUG    [mqttwarn.core             ] Trying to load service "log" from file "/usr/local/lib/python3.11/site-packages/mqttwarn/services/log.py"
mqttwarn   | 2024-02-08 13:35:15,667 INFO     [mqttwarn.core             ] Successfully loaded service "log"
mqttwarn   | 2024-02-08 13:35:15,668 DEBUG    [mqttwarn.core             ] Attempting connection to MQTT broker mosquitto:30123
mqttwarn   | 2024-02-08 13:35:15,669 DEBUG    [mqttwarn.core             ] Setting LWT to /lwt/mqttwarn-mosquitto
mosquitto  | 2024-02-08T13:35:15: Client connection from 172.25.0.3 failed: error:1402542E:SSL routines:ACCEPT_SR_CLNT_HELLO:tlsv1 alert protocol version.
mqttwarn   | 2024-02-08 13:35:15,678 INFO     [mqttwarn.core             ] Publishing status information to mqttwarn/$SYS
mqttwarn   | 2024-02-08 13:35:15,680 WARNING  [mqttwarn.core             ] b'Broker connection lost. Will attempt to reconnect in 5s'
mqttwarn   | 2024-02-08 13:35:15,680 DEBUG    [mqttwarn.core             ] Decoding JSON failed: Expecting value: line 1 column 1 (char 0). payload=Broker connection lost. Will attempt to reconnect in 5s
mqttwarn   | 2024-02-08 13:35:15,681 DEBUG    [mqttwarn.core             ] Message on brokerdisconnected going to log:error
mqttwarn   | 2024-02-08 13:35:15,681 DEBUG    [mqttwarn.core             ] New `log:error' job: brokerdisconnected
mqttwarn   | 2024-02-08 13:35:15,682 DEBUG    [mqttwarn.core             ] Message on brokerdisconnected going to file:mqttwarn
mqttwarn   | 2024-02-08 13:35:15,682 DEBUG    [mqttwarn.core             ] New `file:mqttwarn' job: brokerdisconnected

The mosquitto.conf is:

allow_anonymous false
password_file /mosquitto/config/mosquitto.passwd

persistence true
persistence_location /mosquitto/data

# MQTT over TLS
listener 30123 0.0.0.0
protocol mqtt
certfile /mosquitto/certs/fullchain.pem
keyfile /mosquitto/certs/privkey.pem

# MQTT over websocket with TLS
listener 30124 0.0.0.0
protocol websockets
certfile /mosquitto/certs/fullchain.pem
keyfile /mosquitto/certs/privkey.pem

Also makes no difference if in mqttwarn.ini the value of protocol is 3 or 4.

What am I missing? Should I downgrade to pre-2 mosquitto?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions