Commit 13ead540 authored by Tiago Medicci's avatar Tiago Medicci

Functional support for HTTPS server based on mbedTLS server example

Functional support for HTTPS server based on mbedTLS server example
parent 60cddcc9
This diff is collapsed.
...@@ -27,6 +27,8 @@ extern "C" { ...@@ -27,6 +27,8 @@ extern "C" {
* @brief Simple HTTP server * @brief Simple HTTP server
*/ */
#include "sdkconfig.h"
/* Pull in the definitions of HTTP methods */ /* Pull in the definitions of HTTP methods */
#include "http_parser.h" #include "http_parser.h"
...@@ -38,6 +40,12 @@ extern "C" { ...@@ -38,6 +40,12 @@ extern "C" {
#define HTTP_HANDLE_DATA BIT(2) /*!< Called each time a fragment of request body is received */ #define HTTP_HANDLE_DATA BIT(2) /*!< Called each time a fragment of request body is received */
#define HTTP_HANDLE_RESPONSE BIT(3) /*!< Called at the end of the request to produce the response */ #define HTTP_HANDLE_RESPONSE BIT(3) /*!< Called at the end of the request to produce the response */
/** Error buffer length */
#define ERROR_BUF_LENGTH 100
/** Uncomment to enable secure server */
#define HTTPS_SERVER
/** Opaque type representing single HTTP connection */ /** Opaque type representing single HTTP connection */
typedef struct http_context_* http_context_t; typedef struct http_context_* http_context_t;
...@@ -65,6 +73,14 @@ typedef struct { ...@@ -65,6 +73,14 @@ typedef struct {
.task_priority = 1, \ .task_priority = 1, \
} }
/** Default initializer for http_server_options_t */
#define HTTPS_SERVER_OPTIONS_DEFAULT() {\
.port = 443, \
.task_affinity = tskNO_AFFINITY, \
.task_stack_size = 10240, \
.task_priority = 8, \
}
/** /**
* @brief initialize HTTP server, start listening * @brief initialize HTTP server, start listening
* @param options pointer to http server options, can point to a temporary * @param options pointer to http server options, can point to a temporary
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment