mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 12:10:59 +00:00
esp_https_server : change config option secure_enable to transport_mode and some minor changes
transport_mode accepts enum httpd_ssl_transport_t instead of true/false. This will allow for extension to dual mode (server running on both secure and insecure ports) in the future.
This commit is contained in:
@@ -118,9 +118,9 @@ static esp_err_t httpd_ssl_open(httpd_handle_t server, int sockfd)
|
||||
httpd_sess_set_transport_ctx(server, sockfd, ssl, httpd_ssl_close);
|
||||
|
||||
// Set rx/tx/pending override functions
|
||||
httpd_set_sess_send_override(server, sockfd, httpd_ssl_send);
|
||||
httpd_set_sess_recv_override(server, sockfd, httpd_ssl_recv);
|
||||
httpd_set_sess_pending_override(server, sockfd, httpd_ssl_pending);
|
||||
httpd_sess_set_send_override(server, sockfd, httpd_ssl_send);
|
||||
httpd_sess_set_recv_override(server, sockfd, httpd_ssl_recv);
|
||||
httpd_sess_set_pending_override(server, sockfd, httpd_ssl_pending);
|
||||
|
||||
// all access should now go through SSL
|
||||
|
||||
@@ -183,7 +183,7 @@ esp_err_t httpd_ssl_start(httpd_handle_t *pHandle, struct httpd_ssl_config *conf
|
||||
|
||||
ESP_LOGI(TAG, "Starting server");
|
||||
|
||||
if (config->secure_enable) {
|
||||
if (HTTPD_SSL_TRANSPORT_SECURE == config->transport_mode) {
|
||||
SSL_CTX *ctx = create_secure_context(config);
|
||||
if (!ctx) {
|
||||
return ESP_FAIL;
|
||||
|
Reference in New Issue
Block a user