From d0c646c72162ca0421df84bd941d54735282db52 Mon Sep 17 00:00:00 2001 From: ShellAddicted Date: Mon, 20 Jun 2022 01:17:58 +0200 Subject: [PATCH] Fix: Make MQTT over TLS actually work (#3580) --- esphome/components/mqtt/mqtt_client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/mqtt/mqtt_client.cpp b/esphome/components/mqtt/mqtt_client.cpp index 157504fb41..aa0cf56c51 100644 --- a/esphome/components/mqtt/mqtt_client.cpp +++ b/esphome/components/mqtt/mqtt_client.cpp @@ -187,7 +187,7 @@ void MQTTClientComponent::start_connect_() { this->mqtt_backend_.set_credentials(username, password); - this->mqtt_backend_.set_server((uint32_t) this->ip_, this->credentials_.port); + this->mqtt_backend_.set_server(this->credentials_.address.c_str(), this->credentials_.port); if (!this->last_will_.topic.empty()) { this->mqtt_backend_.set_will(this->last_will_.topic.c_str(), this->last_will_.qos, this->last_will_.retain, this->last_will_.payload.c_str());