ESP32MQTT连接如何配置为TLS1.2安全协议?

ElonStark
Posts: 1
Joined: Thu Oct 29, 2020 6:22 am

ESP32MQTT连接如何配置为TLS1.2安全协议?

Postby ElonStark » Thu Oct 29, 2020 6:53 am

esp_mqtt_client_config_t mqtt_test_cfg = {
.host = CONFIG_ETH_MQTT_TEST_HOST,
.port = CONFIG_ETH_MQTT_TEST_PORT,
.client_id = CHNT_CODE.ctrl_code,
.username = CHNT_CODE.ctrl_code,
.password = CHNT_CODE.brk_code,
.cert_pem = (const char *)mqtt_esp32_pem,
.keepalive = 120,
.lwt_qos = 0,
.lwt_retain = 0,
};

TestClient = esp_mqtt_client_init(&mqtt_test_cfg);
esp_mqtt_client_register_event(TestClient, ESP_EVENT_ANY_ID, ETH_vMqtt_Event_Handler, TestClient);
esp_mqtt_client_start(TestClient);

Who is online

Users browsing this forum: No registered users and 119 guests