Skip to content

Commit 141700a

Browse files
committed
feat(tcp_transport): add API to configure SSL cipher suites
Add new API esp_transport_ssl_set_ciphersuites_list() to allow configuring custom TLS cipher suites in SSL transport layer. This enables users to: - Set specific cipher suites for SSL/TLS connections
1 parent 38628f9 commit 141700a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

components/tcp_transport/include/esp_transport_ssl.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,20 @@ void esp_transport_ssl_skip_common_name_check(esp_transport_handle_t t);
163163
*/
164164
void esp_transport_ssl_set_common_name(esp_transport_handle_t t, const char *common_name);
165165

166+
167+
/**
168+
* @brief Set the SSL cipher suites list
169+
*
170+
* @note This function stores a pointer to the data rather than making a copy.
171+
* Therefore, the data must remain valid until the connection is cleaned up.
172+
* The `ciphersuites_list` is a pointer to a zero-terminated array of IANA identifiers of TLS cipher suites.
173+
* You can verify the validity of the list using the `esp_tls_get_ciphersuites_list()` API.
174+
*
175+
* @param t SSL transport
176+
* @param[in] ciphersuites_list A pointer to a zero-terminated array of IANA identifiers of TLS cipher suites
177+
*/
178+
void esp_transport_ssl_set_ciphersuites_list(esp_transport_handle_t t, const int *ciphersuites_list);
179+
166180
/**
167181
* @brief Set the ssl context to use secure element (atecc608a) for client(device) private key and certificate
168182
*

components/tcp_transport/transport_ssl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,12 @@ void esp_transport_ssl_set_common_name(esp_transport_handle_t t, const char *com
460460
ssl->cfg.common_name = common_name;
461461
}
462462

463+
void esp_transport_ssl_set_ciphersuites_list(esp_transport_handle_t t, const int *ciphersuites_list)
464+
{
465+
GET_SSL_FROM_TRANSPORT_OR_RETURN(ssl, t);
466+
ssl->cfg.ciphersuites_list = ciphersuites_list;
467+
}
468+
463469
#ifdef CONFIG_ESP_TLS_USE_SECURE_ELEMENT
464470
void esp_transport_ssl_use_secure_element(esp_transport_handle_t t)
465471
{

0 commit comments

Comments
 (0)