OVMS3-idf/examples/protocols/https_server
David Cermak 31b2702387 esp_netif, examples: esp_netif_init() moved into ESP_ERROR_CHECK()
esp_netif_init() returns standard esp_err_t error code (unlike tcpip_adapter init), so shall be checked for the return value
Also to make the initialization code more consistent.
2019-12-17 09:07:49 +01:00
..
main esp_netif, examples: esp_netif_init() moved into ESP_ERROR_CHECK() 2019-12-17 09:07:49 +01:00
CMakeLists.txt protocol examples: enable protocol examples for esp32sbeta 2019-11-01 11:14:10 +08:00
Makefile examples/protocols/http(s)_server: use common network component 2019-04-15 03:32:05 +00:00
README.md build system: Use CMake-based build system as default when describing commands 2019-07-08 17:31:27 +10:00
sdkconfig.ci example/https_server: Add default sdkconfig 2019-06-25 23:43:35 +00:00
sdkconfig.defaults esp_netif: include tcpip_adapter legacy header by default to provide *implicit* compatiblity 2019-11-13 12:36:25 +01:00

HTTP server with SSL support using OpenSSL

This example creates a SSL server that returns a simple HTML page when you visit its root URL.

See the esp_https_server component documentation for details.

Before using the example, open the project configuration menu (idf.py menuconfig) to configure Wi-Fi or Ethernet. See "Establishing Wi-Fi or Ethernet Connection" section in examples/protocols/README.md for more details.

Certificates

You will need to approve a security exception in your browser. This is because of a self signed certificate; this will be always the case, unless you preload the CA root into your browser/system as trusted.

You can generate a new certificate using the OpenSSL command line tool:

openssl req -newkey rsa:2048 -nodes -keyout prvtkey.pem -x509 -days 3650 -out cacert.pem -subj "/CN=ESP32 HTTPS server example"

Expiry time and metadata fields can be adjusted in the invocation.

Please see the openssl man pages (man openssl-req) for more details.

It is strongly recommended to not reuse the example certificate in your application; it is included only for demonstration.