use http instead of https, makes it easier to work downstream
This commit is contained in:
18
main/main.c
18
main/main.c
@@ -8,7 +8,7 @@
|
|||||||
#include "esp_eth.h"
|
#include "esp_eth.h"
|
||||||
#include "protocol_examples_common.h"
|
#include "protocol_examples_common.h"
|
||||||
|
|
||||||
#include <esp_https_server.h>
|
#include <esp_http_server.h>
|
||||||
#include "bme280.h"
|
#include "bme280.h"
|
||||||
|
|
||||||
static const char *TAG = "BME280";
|
static const char *TAG = "BME280";
|
||||||
@@ -114,19 +114,9 @@ static httpd_handle_t start_webserver(void)
|
|||||||
// Start the httpd server
|
// Start the httpd server
|
||||||
ESP_LOGI(TAG, "Starting server");
|
ESP_LOGI(TAG, "Starting server");
|
||||||
|
|
||||||
httpd_ssl_config_t conf = HTTPD_SSL_CONFIG_DEFAULT();
|
httpd_config_t conf = HTTPD_DEFAULT_CONFIG();
|
||||||
|
|
||||||
extern const unsigned char cacert_pem_start[] asm("_binary_cacert_pem_start");
|
esp_err_t ret = httpd_start(&server, &conf);
|
||||||
extern const unsigned char cacert_pem_end[] asm("_binary_cacert_pem_end");
|
|
||||||
conf.cacert_pem = cacert_pem_start;
|
|
||||||
conf.cacert_len = cacert_pem_end - cacert_pem_start;
|
|
||||||
|
|
||||||
extern const unsigned char prvtkey_pem_start[] asm("_binary_prvtkey_pem_start");
|
|
||||||
extern const unsigned char prvtkey_pem_end[] asm("_binary_prvtkey_pem_end");
|
|
||||||
conf.prvtkey_pem = prvtkey_pem_start;
|
|
||||||
conf.prvtkey_len = prvtkey_pem_end - prvtkey_pem_start;
|
|
||||||
|
|
||||||
esp_err_t ret = httpd_ssl_start(&server, &conf);
|
|
||||||
if (ESP_OK != ret) {
|
if (ESP_OK != ret) {
|
||||||
ESP_LOGI(TAG, "Error starting server!");
|
ESP_LOGI(TAG, "Error starting server!");
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -140,7 +130,7 @@ static httpd_handle_t start_webserver(void)
|
|||||||
|
|
||||||
static void stop_webserver(httpd_handle_t server)
|
static void stop_webserver(httpd_handle_t server)
|
||||||
{
|
{
|
||||||
httpd_ssl_stop(server);
|
httpd_stop(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void disconnect_handler(void* arg, esp_event_base_t event_base,
|
static void disconnect_handler(void* arg, esp_event_base_t event_base,
|
||||||
|
|||||||
Reference in New Issue
Block a user