Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions port/esp_tls_wolfssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,17 @@ static esp_err_t set_client_config(const char *hostname, size_t hostlen, esp_tls
return ESP_ERR_WOLFSSL_SSL_SET_HOSTNAME_FAILED;
}
free(use_host);
} else {
/* skip_common_name only disables hostname *verification* of the peer
* certificate; SNI must still be sent so the server presents the
* certificate for the requested host (e.g. virtual hosts / CDNs).
* See esp-idf PR #14684. */
if (hostname != NULL && hostlen > 0) {
if ((ret = wolfSSL_UseSNI(tls->priv_ssl, WOLFSSL_SNI_HOST_NAME, hostname, hostlen)) != WOLFSSL_SUCCESS) {
ESP_LOGE(TAG, "wolfSSL_UseSNI failed, returned %d", ret);
return ESP_ERR_WOLFSSL_SSL_SET_HOSTNAME_FAILED;
}
}
}

if (cfg->alpn_protos) {
Expand Down