Skip to content
This repository was archived by the owner on Jun 15, 2020. It is now read-only.

TLS/SSL secured server support. #6

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
Simple HTTP server
------------------
# Simple HTTP/HTTPS server

This is a very minimal HTTP server I use in some of the projects.
This is a very minimal HTTP server. Optionally supports HTTPS server based on mbedTLS server example.

Absolutely not ready for any kind of production use.

How to use
----------

Really, please see above note.
# How to use

This directory is an ESP-IDF component. Clone it (or add it as a submodule) into the component directory of the project.
Enable TLS/SSL HTTPS server by uncommenting the `#define HTTPS_SERVER` line at `https_server.h`, otherwise it will implement unsecured http server. Server certificate and private key are loaded at `https_server.c` directly into flash code as in the [`open_ssl_server`](https://github.com/espressif/esp-idf/tree/master/examples/protocols/openssl_server) example from ESP-IDF repository. Don't forget to insert [`cacert.pem`](https://github.com/espressif/esp-idf/blob/master/examples/protocols/openssl_server/main/cacert.pem) and [`prvtkey.pem`](https://github.com/espressif/esp-idf/blob/master/examples/protocols/openssl_server/main/prvtkey.pem) at your main application directory if you want to run GET/POST examples.


Documentation
-------------
# Documentation

None yet, but I tried to make the comments in the header file helpful.

# Examples

Example
-------
Examples functions at http server:

None yet.
## GET Method Example

`simple_GET_method_example()` function:

* Add http_server.c and http_server.h as a component into your project.
* Server initialization added into the example function, simply call it and it should work!
* Receiving a GET request at /, http server response is a "Hello World, from ESP32!" html.

Debugging
---------
## POST Method Example
`simple_POST_method_example()` function:
* As well as GET example, simply add http_server as a componente into your ESP-IDF project.
* Server initialization added into the POST example function, simply call it and don't worry.
* Post to / a pair of key-value where the key is 'key' and value some value you want to test. The example will show value content. If needed, increade log verbosity at `make menuconfig` to show all parsed key-value pairs.

Increasing log level to "Verbose" should produce lots of output related to request handling.
# Debugging

Increasing log level to "Verbose" should produce lots of output related to request handling.

License
-------

GPL, see [LICENSE](LICENSE) file. Mostly because this is a very early version. Will be relicensed as something more reasonable later.
# License

GPL, see [LICENSE](LICENSE) file. Mostly because this is a very early version. Will be relicensed as something more reasonable later. mbedTLS are Apache 2.0 licensed.
Loading