mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-07 06:34:34 +02:00
Merge branch 'contrib/github_pr_8462' into 'master'
Add WolfSSL esp_tls TLS1.3 configuration option (GitHub PR) Closes IDFGH-6838 and IDFGH-6683 See merge request espressif/esp-idf!17324
This commit is contained in:
@@ -168,7 +168,13 @@ exit:
|
|||||||
static esp_err_t set_client_config(const char *hostname, size_t hostlen, esp_tls_cfg_t *cfg, esp_tls_t *tls)
|
static esp_err_t set_client_config(const char *hostname, size_t hostlen, esp_tls_cfg_t *cfg, esp_tls_t *tls)
|
||||||
{
|
{
|
||||||
int ret = WOLFSSL_FAILURE;
|
int ret = WOLFSSL_FAILURE;
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_TLS13
|
||||||
|
tls->priv_ctx = (void *)wolfSSL_CTX_new(wolfTLSv1_3_client_method());
|
||||||
|
#else
|
||||||
tls->priv_ctx = (void *)wolfSSL_CTX_new(wolfTLSv1_2_client_method());
|
tls->priv_ctx = (void *)wolfSSL_CTX_new(wolfTLSv1_2_client_method());
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!tls->priv_ctx) {
|
if (!tls->priv_ctx) {
|
||||||
ESP_LOGE(TAG, "Set wolfSSL ctx failed");
|
ESP_LOGE(TAG, "Set wolfSSL ctx failed");
|
||||||
ESP_INT_EVENT_TRACKER_CAPTURE(tls->error_handle, ESP_TLS_ERR_TYPE_WOLFSSL, ret);
|
ESP_INT_EVENT_TRACKER_CAPTURE(tls->error_handle, ESP_TLS_ERR_TYPE_WOLFSSL, ret);
|
||||||
@@ -310,7 +316,13 @@ static esp_err_t set_client_config(const char *hostname, size_t hostlen, esp_tls
|
|||||||
static esp_err_t set_server_config(esp_tls_cfg_server_t *cfg, esp_tls_t *tls)
|
static esp_err_t set_server_config(esp_tls_cfg_server_t *cfg, esp_tls_t *tls)
|
||||||
{
|
{
|
||||||
int ret = WOLFSSL_FAILURE;
|
int ret = WOLFSSL_FAILURE;
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_TLS13
|
||||||
|
tls->priv_ctx = (void *)wolfSSL_CTX_new(wolfTLSv1_3_server_method());
|
||||||
|
#else
|
||||||
tls->priv_ctx = (void *)wolfSSL_CTX_new(wolfTLSv1_2_server_method());
|
tls->priv_ctx = (void *)wolfSSL_CTX_new(wolfTLSv1_2_server_method());
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!tls->priv_ctx) {
|
if (!tls->priv_ctx) {
|
||||||
ESP_LOGE(TAG, "Set wolfSSL ctx failed");
|
ESP_LOGE(TAG, "Set wolfSSL ctx failed");
|
||||||
return ESP_ERR_WOLFSSL_CTX_SETUP_FAILED;
|
return ESP_ERR_WOLFSSL_CTX_SETUP_FAILED;
|
||||||
|
Reference in New Issue
Block a user