docs: Add documentation for using TLS v1.2 and v1.3 simultaneously

This commit is contained in:
Harshit Malpani
2023-11-10 16:37:39 +08:00
committed by Mahavir Jain
parent 818ba42a8b
commit c67dac7225
4 changed files with 68 additions and 0 deletions
@@ -138,6 +138,20 @@ Expected data types for different HTTP Client events in the event loop are as fo
The :cpp:type:`esp_http_client_handle_t` received along with the event data will be valid until :cpp:enumerator:`HTTP_EVENT_DISCONNECTED <esp_http_client_event_id_t::HTTP_EVENT_DISCONNECTED>` is not received. This handle has been sent primarily to differentiate between different client connections and must not be used for any other purpose, as it may change based on client connection state.
TLS Protocol Version
--------------------
TLS protocol version to be used for the underlying TLS connection can be set in :cpp:type:`esp_http_client_config_t`. Please refer to the **TLS Protocol Version** section in the :doc:`/api-reference/protocols/esp_tls` for more details.
The TLS protocol version for the HTTP client can be configured as follows:
.. code-block:: c
#include "esp_http_client.h"
esp_http_client_config_t config = {
.tls_version = ESP_HTTP_CLIENT_TLS_VER_TLS_1_2,
};
API Reference
-------------
@@ -244,6 +244,26 @@ ESP-TLS will not check the validity of ``ciphersuites_list`` that was set, you s
This feature is supported only in the MbedTLS stack.
TLS Protocol Version
--------------------
ESP-TLS provides the ability to set the TLS protocol version for the respective TLS connection. Once the version is specified, it should be exclusively used to establish the TLS connection. This provides an ability to route different TLS connections to different protocol versions like TLS 1.2 and TLS 1.3 at runtime.
.. note::
At the moment, the feature is supported only when ESP-TLS is used with MbedTLS as its underlying SSL/TLS stack.
To set TLS protocol version with ESP-TLS, set :cpp:member:`esp_tls_cfg_t::tls_version` to the required protocol version from :cpp:type:`esp_tls_proto_ver_t`. If the protocol version field is not set, then the default policy is to allow TLS connection based on the server requirement.
The ESP-TLS connection can be configured to use the specified protocol version as follows:
.. code-block:: c
#include "esp_tls.h"
esp_tls_cfg_t cfg = {
.tls_version = ESP_TLS_VER_TLS_1_2,
};
API Reference
-------------