MQTT: add server side authentication to mutual auth example

This commit is contained in:
Marius Vikhammer
2020-08-11 17:36:24 +08:00
parent 7acda7b8eb
commit a54291b22b
5 changed files with 31 additions and 1 deletions

View File

@@ -35,6 +35,8 @@ extern const uint8_t client_cert_pem_start[] asm("_binary_client_crt_start");
extern const uint8_t client_cert_pem_end[] asm("_binary_client_crt_end");
extern const uint8_t client_key_pem_start[] asm("_binary_client_key_start");
extern const uint8_t client_key_pem_end[] asm("_binary_client_key_end");
extern const uint8_t server_cert_pem_start[] asm("_binary_mosquitto_org_crt_start");
extern const uint8_t server_cert_pem_end[] asm("_binary_mosquitto_org_crt_end");
static esp_err_t mqtt_event_handler(esp_mqtt_event_handle_t event)
{
@@ -90,6 +92,7 @@ static void mqtt_app_start(void)
.event_handle = mqtt_event_handler,
.client_cert_pem = (const char *)client_cert_pem_start,
.client_key_pem = (const char *)client_key_pem_start,
.cert_pem = (const char *)server_cert_pem_start,
};
ESP_LOGI(TAG, "[APP] Free memory: %d bytes", esp_get_free_heap_size());