mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 21:44:55 +01:00
fix streaming logs from MQTT for ESP32 devices using TLS (#6605)
This commit is contained in:
parent
a29e634af1
commit
dd8be524b4
1 changed files with 4 additions and 1 deletions
|
@ -10,6 +10,7 @@ import paho.mqtt.client as mqtt
|
||||||
|
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_BROKER,
|
CONF_BROKER,
|
||||||
|
CONF_CERTIFICATE_AUTHORITY,
|
||||||
CONF_DISCOVERY_PREFIX,
|
CONF_DISCOVERY_PREFIX,
|
||||||
CONF_ESPHOME,
|
CONF_ESPHOME,
|
||||||
CONF_LOG_TOPIC,
|
CONF_LOG_TOPIC,
|
||||||
|
@ -99,7 +100,9 @@ def prepare(
|
||||||
elif username:
|
elif username:
|
||||||
client.username_pw_set(username, password)
|
client.username_pw_set(username, password)
|
||||||
|
|
||||||
if config[CONF_MQTT].get(CONF_SSL_FINGERPRINTS):
|
if config[CONF_MQTT].get(CONF_SSL_FINGERPRINTS) or config[CONF_MQTT].get(
|
||||||
|
CONF_CERTIFICATE_AUTHORITY
|
||||||
|
):
|
||||||
if sys.version_info >= (2, 7, 13):
|
if sys.version_info >= (2, 7, 13):
|
||||||
tls_version = ssl.PROTOCOL_TLS # pylint: disable=no-member
|
tls_version = ssl.PROTOCOL_TLS # pylint: disable=no-member
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue