user180574
user180574

Reputation: 6084

MQTT broker TLS error when connecting with client

I am testing a C code using mosquitto library.

First, below is the broker conf related to TLS.

per_listener_settings true

listener 1883 0.0.0.0
allow_anonymous true

listener 8883 0.0.0.0
max_connections -1
certfile /home/.../server.crt
keyfile /home/.../server.key
#crlfile /mosquitto/config/certificates/ca.crl
require_certificate true
tls_version tlsv1.2
cafile /home/.../ca.crt
allow_anonymous false

Below is the client side code.

mqtt = mosquitto_new(NULL, true, this);
mosquitto_tls_set(mqtt, ca_path, client_cert_path, client_private_key_path, NULL);
mosquitto_tls_opts_set(mqtt, 1, "tlsv1.2", NULL);
mosquitto_connect(mqtt, broker_address, 8883, 61);
mosquitto_loop_start(mqtt);

There is no error reported from the client side. Below is the broker error.

1733809961: New connection from 112.122.223.234 on port 8883.
1733809961: OpenSSL Error[0]: error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error
1733809961: Socket error on client <unknown>, disconnecting.

Any idea?

Upvotes: 0

Views: 50

Answers (0)

Related Questions