only activate WiFiClientSecure when skip cert true

This commit is contained in:
hermlon 2024-09-13 08:29:30 +02:00
parent 27865935fe
commit 70b54ab422

View file

@ -401,6 +401,7 @@ async def to_code(config):
cg.add(var.set_ssl_fingerprint(arr)) cg.add(var.set_ssl_fingerprint(arr))
if CONF_SKIP_CERT_CN_CHECK in config: if CONF_SKIP_CERT_CN_CHECK in config:
if config[CONF_SKIP_CERT_CN_CHECK]:
cg.add_define("USE_MQTT_SECURE_CLIENT") cg.add_define("USE_MQTT_SECURE_CLIENT")
cg.add(var.set_skip_cert_cn_check(config[CONF_SKIP_CERT_CN_CHECK])) cg.add(var.set_skip_cert_cn_check(config[CONF_SKIP_CERT_CN_CHECK]))