From ad4360704fd5cf5bef64eccaa54a8f388484dd2d Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 1 Jan 2022 19:55:56 +0100 Subject: [PATCH] Home: New MQTT server --- arexxd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arexxd.c b/arexxd.c index a47ba8d..e083c52 100644 --- a/arexxd.c +++ b/arexxd.c @@ -136,12 +136,15 @@ static void mqtt_init(void) if (!mosq) die("Mosquitto: initialization failed"); + if (mosquitto_tls_set(mosq, "/etc/burrow-mqtt/ca.crt", NULL, "/etc/burrow-mqtt/client.crt", "/etc/burrow-mqtt/client.key", NULL) != MOSQ_ERR_SUCCESS) + die("Mosquitto: unable to set TLS parameters"); + if (mosquitto_will_set(mosq, "status/arexxd", 4, "dead", 0, true) != MOSQ_ERR_SUCCESS) die("Mosquitto: unable to set will"); mosquitto_connect_callback_set(mosq, mqtt_conn_callback); - if (mosquitto_connect(mosq, "10.32.184.5", 1883, 60) != MOSQ_ERR_SUCCESS) + if (mosquitto_connect(mosq, "burrow-mqtt", 8883, 60) != MOSQ_ERR_SUCCESS) die("Mosquitto: connect failed"); if (mosquitto_loop_start(mosq)) -- 2.39.2