You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/en/404.rst
+3-2
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,18 @@
2
2
3
3
Page not Found
4
4
==============
5
+
5
6
:link_to_translation:`zh_CN:[中文]`
6
7
7
8
.. note::
8
9
9
-
We're sorry. The page you requested could not be found. This error occurs maybe because the current chip or version you choose does not support the feature you are looking for. If you want to provide feedback about this document, please let us know what exact document you want to access, so that we can better help you.
10
+
We are sorry. The page you requested could not be found. This error occurs maybe because the current chip or version you choose does not support the feature you are looking for. If you want to provide feedback about this document, please let us know what exact document you want to access, so that we can better help you.
10
11
11
12
Please use the menu on the left to navigate through documentation contents. Optionally type the phrase you are looking for in the search box above the menu and press enter.
12
13
13
14
.. figure:: ../_static/404-page__en.svg
14
15
:align:center
15
-
:alt:We're sorry. The page you requested could not be found.
16
+
:alt:We are sorry. The page you requested could not be found.
Copy file name to clipboardexpand all lines: docs/en/api-reference/protocols/esp_crt_bundle.rst
+12-6
Original file line number
Diff line number
Diff line change
@@ -6,18 +6,22 @@ Overview
6
6
7
7
The ESP x509 Certificate Bundle API provides an easy way to include a bundle of custom x509 root certificates for TLS server verification.
8
8
9
-
.. note::The bundle is currently not available when using WolfSSL.
9
+
.. note::
10
10
11
-
The bundle comes with the complete list of root certificates from Mozilla’s NSS root certificate store. Using the gen_crt_bundle.py python utility the certificates’ subject name and public key are stored in a file and embedded in the {IDF_TARGET_NAME} binary.
11
+
The bundle is currently not available when using WolfSSL.
12
+
13
+
The bundle comes with the complete list of root certificates from Mozilla's NSS root certificate store. Using the gen_crt_bundle.py python utility the certificates' subject name and public key are stored in a file and embedded in the {IDF_TARGET_NAME} binary.
12
14
13
15
When generating the bundle you may choose between:
14
16
15
17
* The full root certificate bundle from Mozilla, containing more than 130 certificates. The current bundle was updated Tue Jan 10 04:12:06 2023 GMT.
16
18
* A pre-selected filter list of the name of the most commonly used root certificates, reducing the amount of certificates to around 41 while still having around 90% absolute usage coverage and 99% market share coverage according to SSL certificate authorities statistics.
17
19
18
-
In addition it is possible to specify a path to a certificate file or a directory containing certificates which then will be added to the generated bundle.
20
+
In addition, it is possible to specify a path to a certificate file or a directory containing certificates which then will be added to the generated bundle.
21
+
22
+
.. note::
19
23
20
-
.. note:: Trusting all root certificates means the list will have to be updated if any of the certificates are retracted. This includes removing them from `cacrt_all.pem`.
24
+
Trusting all root certificates means the list will have to be updated if any of the certificates are retracted. This includes removing them from ``cacrt_all.pem``.
21
25
22
26
Configuration
23
27
-------------
@@ -30,7 +34,7 @@ Most configuration is done through menuconfig. CMake will generate the bundle ac
30
34
31
35
To enable the bundle when using ESP-TLS simply pass the function pointer to the bundle attach function:
32
36
33
-
.. code:: c
37
+
.. code-block:: c
34
38
35
39
esp_tls_cfg_t cfg = {
36
40
.crt_bundle_attach = esp_crt_bundle_attach,
@@ -40,7 +44,7 @@ This is done to avoid embedding the certificate bundle unless activated by the u
40
44
41
45
If using mbedTLS directly then the bundle may be activated by directly calling the attach function during the setup process:
42
46
43
-
.. code:: c
47
+
.. code-block:: c
44
48
45
49
mbedtls_ssl_config conf;
46
50
mbedtls_ssl_config_init(&conf);
@@ -53,10 +57,12 @@ If using mbedTLS directly then the bundle may be activated by directly calling t
53
57
Generating the List of Root Certificates
54
58
----------------------------------------
55
59
The list of root certificates comes from Mozilla's NSS root certificate store, which can be found `here <https://wiki.mozilla.org/CA/Included_Certificates>`_
60
+
56
61
The list can be downloaded and created by running the script ``mk-ca-bundle.pl`` that is distributed as a part of `curl <https://github.com/curl/curl>`_.
57
62
Another alternative would be to download the finished list directly from the curl website: `CA certificates extracted from Mozilla <https://curl.se/docs/caextract.html>`_
58
63
59
64
The common certificates bundle were made by selecting the authorities with a market share of more than 1 % from w3tech's `SSL Survey <https://w3techs.com/technologies/overview/ssl_certificate>`_.
65
+
60
66
These authorities were then used to pick the names of the certificates for the filter list, `cmn_crt_authorities.csv`, from `this list <https://ccadb-public.secure.force.com/mozilla/IncludedCACertificateReportPEMCSV>`_ provided by Mozilla.
Copy file name to clipboardexpand all lines: docs/en/api-reference/protocols/esp_http_client.rst
+7-4
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,15 @@
1
1
ESP HTTP Client
2
2
===============
3
+
3
4
:link_to_translation:`zh_CN:[中文]`
4
5
5
6
Overview
6
7
--------
7
8
8
9
``esp_http_client`` component provides a set of APIs for making HTTP/S requests from ESP-IDF applications. The steps to use these APIs are as follows:
9
10
10
-
* :cpp:func:`esp_http_client_init`: Creates an :cpp:type:`esp_http_client_handle_t` instance, i.e., an HTTP client handle based on the given :cpp:type:`esp_http_client_config_t` configuration. This function must be the first to be called; default values will be assumed for the configuration values that are not explicitly defined by the user.
11
-
* :cpp:func:`esp_http_client_perform`: Performs all operations of the ``esp_http_client`` - opening the connection, exchanging data, and closing the connection (as required), while blocking the current task before its completion. All related events will be invoked through the event handler (as specified in :cpp:type:`esp_http_client_config_t`).
11
+
* :cpp:func:`esp_http_client_init`: Creates an :cpp:type:`esp_http_client_handle_t` instance, i.e., an HTTP client handle based on the given :cpp:type:`esp_http_client_config_t` configuration. This function must be the first to be called; default values are assumed for the configuration values that are not explicitly defined by the user.
12
+
* :cpp:func:`esp_http_client_perform`: Performs all operations of the ``esp_http_client`` - opening the connection, exchanging data, and closing the connection (as required), while blocking the current task before its completion. All related events are invoked through the event handler (as specified in :cpp:type:`esp_http_client_config_t`).
12
13
* :cpp:func:`esp_http_client_cleanup`: Closes the connection (if any) and frees up all the memory allocated to the HTTP client instance. This must be the last function to be called after the completion of operations.
13
14
14
15
@@ -36,7 +37,7 @@ To allow ESP HTTP client to take full advantage of persistent connections, one s
36
37
Use Secure Element (ATECC608) for TLS
37
38
_____________________________________
38
39
39
-
A secure element (ATECC608) can be also used for the underlying TLS connection in the HTTP client connection. Please refer to the *ATECC608A (Secure Element) with ESP-TLS* section in the :doc:`ESP-TLS documentation </api-reference/protocols/esp_tls>` for more details. The secure element support has to be first enabled in menuconfig through :ref:`CONFIG_ESP_TLS_USE_SECURE_ELEMENT`. Then the HTTP client can be configured to use secure element as follows:
40
+
A secure element (ATECC608) can be also used for the underlying TLS connection in the HTTP client connection. Please refer to the **ATECC608A (Secure Element) with ESP-TLS** section in the :doc:`ESP-TLS documentation </api-reference/protocols/esp_tls>` for more details. The secure element support has to be first enabled in menuconfig through :ref:`CONFIG_ESP_TLS_USE_SECURE_ELEMENT`. Then the HTTP client can be configured to use secure element as follows:
40
41
41
42
.. code-block:: c
42
43
@@ -51,7 +52,9 @@ HTTPS Request
51
52
52
53
ESP HTTP client supports SSL connections using **mbedTLS**, with the ``url`` configuration starting with ``https`` scheme or ``transport_type`` set to ``HTTP_TRANSPORT_OVER_SSL``. HTTPS support can be configured via :ref:`CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS` (enabled by default).
53
54
54
-
.. note:: While making HTTPS requests, if server verification is needed, an additional root certificate (in PEM format) needs to be provided to the ``cert_pem`` member in the ``esp_http_client_config_t`` configuration. Users can also use the ``ESP x509 Certificate Bundle`` for server verification using the ``crt_bundle_attach`` member of the ``esp_http_client_config_t`` configuration.
55
+
.. note::
56
+
57
+
While making HTTPS requests, if server verification is needed, an additional root certificate (in PEM format) needs to be provided to the ``cert_pem`` member in the ``esp_http_client_config_t`` configuration. Users can also use the ``ESP x509 Certificate Bundle`` for server verification using the ``crt_bundle_attach`` member of the ``esp_http_client_config_t`` configuration.
55
58
56
59
Check out the example functions ``https_with_url`` and ``https_with_hostname_path`` in the application example for implementation details of the above note.
Copy file name to clipboardexpand all lines: docs/en/api-reference/protocols/esp_http_server.rst
+4-8
Original file line number
Diff line number
Diff line change
@@ -8,16 +8,14 @@ Overview
8
8
9
9
The HTTP Server component provides an ability for running a lightweight web server on {IDF_TARGET_NAME}. Following are detailed steps to use the API exposed by HTTP Server:
10
10
11
-
* :cpp:func:`httpd_start`: Creates an instance of HTTP server, allocate memory/resources for it depending upon the specified configuration and outputs a handle to the server instance. The server has both, a listening socket (TCP) for HTTP traffic, and a control socket (UDP) for control signals, which are selected in a round robin fashion in the server task loop. The task priority and stack size are configurable during server instance creation by passing httpd_config_t structure to httpd_start(). TCP traffic is parsed as HTTP requests and, depending on the requested URI, user registered handlers are invoked which are supposed to send back HTTP response packets.
12
-
* :cpp:func:`httpd_stop`: This stops the server with the provided handle and frees up any associated memory/resources. This is a blocking function that first signals a halt to the server task and then waits for the task to terminate. While stopping, the task will close all open connections, remove registered URI handlers and reset all session context data to empty.
11
+
* :cpp:func:`httpd_start`: Creates an instance of HTTP server, allocate memory/resources for it depending upon the specified configuration and outputs a handle to the server instance. The server has both, a listening socket (TCP) for HTTP traffic, and a control socket (UDP) for control signals, which are selected in a round robin fashion in the server task loop. The task priority and stack size are configurable during server instance creation by passing ``httpd_config_t`` structure to ``httpd_start()``. TCP traffic is parsed as HTTP requests and, depending on the requested URI, user registered handlers are invoked which are supposed to send back HTTP response packets.
12
+
* :cpp:func:`httpd_stop`: This stops the server with the provided handle and frees up any associated memory/resources. This is a blocking function that first signals a halt to the server task and then waits for the task to terminate. While stopping, the task closes all open connections, removes registered URI handlers and resets all session context data to empty.
13
13
* :cpp:func:`httpd_register_uri_handler`: A URI handler is registered by passing object of type ``httpd_uri_t`` structure which has members including ``uri`` name, ``method`` type (eg. ``HTTPD_GET/HTTPD_POST/HTTPD_PUT`` etc.), function pointer of type ``esp_err_t *handler (httpd_req_t *req)`` and ``user_ctx`` pointer to user context data.
14
14
15
15
Application Example
16
16
-------------------
17
17
18
-
.. highlight:: c
19
-
20
-
::
18
+
.. code-block:: c
21
19
22
20
/* Our URI handler function to be called during GET /uri request */
23
21
esp_err_t get_handler(httpd_req_t *req)
@@ -119,9 +117,7 @@ HTTP server features persistent connections, allowing for the re-use of the same
0 commit comments