Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
de1876c
GitHub Workflows: Update actions
fhessel Jan 23, 2021
0e870fd
sha.h header moved from hwcrypto to esp32
jackjansen Jun 9, 2022
d4dd455
CI builds on this branch
jackjansen Jun 9, 2022
1cfcef4
esp32/sha.h is also deprecated. Use sha/sha_parallel_engine.h
jackjansen Jun 9, 2022
aace047
Update HTTPConnection.hpp
jasenk2 Jul 24, 2022
7aec8fe
Update HTTPConnection.cpp
jasenk2 Jul 24, 2022
f593a71
Revert "CI builds on this branch"
jackjansen Oct 7, 2022
c79117b
Quick workaround for TAG not being defined
jackjansen Oct 13, 2022
2780e9f
fix tag
JasenKolev Dec 11, 2022
d87e59a
change from openssl to esp_tls
JasenKolev Dec 11, 2022
8bf72f1
remove old comments
JasenKolev Dec 11, 2022
7adefd6
ready to merge
JasenKolev Dec 12, 2022
e48c4a2
Upgrade some verions
jackjansen Aug 11, 2023
9a3726d
Treat branch for-iotsa as similar to master.
jackjansen Jul 7, 2024
7cbaf1d
Merge branch 'exp-jack-sha-header' into for-iotsa
jackjansen Jul 21, 2024
af1c21f
Preparing for v1.1.0 release from esp32_idf5_https_server
jackjansen Jul 21, 2024
0bd8a47
Updated version
jackjansen Jul 21, 2024
b76e659
Add header files, compatible with esp32s3
lewisxhe Sep 6, 2022
1e94c7d
init the serial with a random value
caveman99 Nov 21, 2022
169c1f0
correct whitespace
caveman99 Nov 21, 2022
57cd884
pio, cert
mhaberler Jul 9, 2024
b57a13c
wip
mhaberler Jul 19, 2024
7367b94
fails with pioarduino 3.0.3 which is based on ESP-IDF 5.1.4:
mhaberler Jul 22, 2024
17b4c37
stop for now
mhaberler Jul 23, 2024
2c50b67
apply fix for mbedtls_x509write_crt_set_serial() deprecation
mhaberler Jul 23, 2024
445d971
update to mbedTLS 3.4.0 API
mhaberler Jul 23, 2024
33cbe2d
make example work with pioarduino/platform-espressif32
mhaberler Jul 23, 2024
e66658a
Attempting to fix ci/cd by renaming example cpp file to .ino
jackjansen Aug 3, 2024
33ca02c
mbedtls_sha1_ret changed to mbedtls_sha1
jackjansen Aug 4, 2024
067f31f
v1.1.1
jackjansen Aug 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/build-examples-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- for-iotsa
jobs:
build-examples:
strategy:
Expand All @@ -27,11 +28,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@f90c7b395dac7c5a277c1a6d93d5057c1cddb74e
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@9ac730844c47e52575257e93faf193c4530bc095
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-examples-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
if: "contains( github.event.pull_request.labels.*.name, 'CI: Build Examples' )"
steps:
- name: Checkout codebase
uses: actions/checkout@f90c7b395dac7c5a277c1a6d93d5057c1cddb74e
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@9ac730844c47e52575257e93faf193c4530bc095
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install PlatformIO
Expand All @@ -43,7 +43,7 @@ jobs:
if: "contains( github.event.pull_request.labels.*.name, 'CI: Build Examples' )"
steps:
- name: Remove Label from PR
uses: octokit/request-action@57ec46afcc4c58c813af3afe67e57ced1ea9f165
uses: octokit/request-action@91508edec0a9561c2fefb9282491ced243bed312
with:
route: DELETE /repos/:repository/issues/:issue_number/labels/:name
repository: ${{ github.repository }}
Expand Down
15 changes: 5 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# Changelog

## [pending (master)](https://github.com/fhessel/esp32_https_server/tree/master)
## [v1.1.1](https://github.com/jackjansen/esp32_idf5_https_server/tree/master)

New functionality:


Bug fixes:

- Addressed issues with esp32-arduino-core v3 and esp-idf 5.0

Breaking changes:
## [v1.1.0](https://github.com/jackjansen/esp32_idf5_https_server/tree/master)

- Compatible with ESP-IDF 5.0
- Use esp-tls in stead of openssl

## [v1.0.0](https://github.com/fhessel/esp32_https_server/releases/tag/v1.0.0)

Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# ESP32 HTTPS Server
# ESP32 HTTPS Server, IDF5 fork

![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/fhessel/esp32_https_server?label=Version&sort=semver) ![Build Examples](https://github.com/fhessel/esp32_https_server/workflows/Build%20Examples/badge.svg?branch=master)
This repository is a fork of `fhessel/esp32_https_server`. The only reason for its existence is that it seems _fhessel_ currently does not have the time to maintain `esp32_https_server`, and due to changes in the underlying Espressif frameworks such as `ESP_IDF` it has stopped working.

This forked repository has just enough changes so that the library works. It is hoped that it will go away in the future (after a warning period) when `esp32_idf_server` maintainance is picked up again.

In the following instructions

- replace every mention of `esp32_https_server` with `esp32_idf5_https_server`

## Original readme of esp32_https_server

This repository contains an HTTPS server library that can be used with the [ESP32 Arduino Core](https://github.com/espressif/arduino-esp32). It supports HTTP as well.

Expand Down
53 changes: 53 additions & 0 deletions boards/esp32-s3-devkitc-1-32MB-8MB.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld",
"partitions": "large_littlefs_32MB.csv",
"memory_type": "opi_opi"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_ESP32S3_DEV",
"-DARDUINO_USB_MODE=0",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1",
"-DBOARD_HAS_PSRAM"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"boot": "opi",
"hwids": [
[
"0X303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": [
"wifi"
],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": [
"esp-builtin"
],
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif ESP32-S3-DevKitC-2-opi",
"upload": {
"flash_size": "32MB",
"maximum_ram_size": 327680,
"maximum_size": 33554432,
"require_upload_port": true,
"speed": 460800
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html",
"vendor": "Espressif"
}
9 changes: 9 additions & 0 deletions example.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[ req ]
distinguished_name = req_distinguished_name
prompt = no
[ req_distinguished_name ]
C = DE
ST = BE
L = Berlin
O = MyCompany
CN = esp32.local
15 changes: 15 additions & 0 deletions example.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-----BEGIN CERTIFICATE-----
MIICYTCCAcqgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBUMQswCQYDVQQGEwJERTEL
MAkGA1UECAwCQkUxDzANBgNVBAcMBkJlcmxpbjESMBAGA1UECgwJTXlDb21wYW55
MRMwEQYDVQQDDApteWNhLmxvY2FsMB4XDTI0MDcwOTEwMTEwN1oXDTM0MDcwNzEw
MTEwN1owVTELMAkGA1UEBhMCREUxCzAJBgNVBAgMAkJFMQ8wDQYDVQQHDAZCZXJs
aW4xEjAQBgNVBAoMCU15Q29tcGFueTEUMBIGA1UEAwwLZXNwMzIubG9jYWwwgZ8w
DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAK/aY9jhRfEAgfu3KeTNQ1T2CshDP12e
benmLPnnVG830HQhMLIe1itN/f0tPTguUYtOBgUS9w2zeZEdm6aqeskkkV55Wnmz
IhGNg/cuwl/zp98NbOsZ4Rwcjp5dtL5w8UnlIsK8PsFntRWHQOthgaKH3YzyGg65
ZtPKD13/ZGXbAgMBAAGjQjBAMB0GA1UdDgQWBBTBnWcv/0066SQSwr7nvZc0bg8B
fzAfBgNVHSMEGDAWgBTCqpgyA21IXR4Maq4makkkGgy66TANBgkqhkiG9w0BAQsF
AAOBgQAV0W4470+7/P5bRd94GYyF16/DR1W/H4NITptAJsMGjdyOaRVQnebCYP73
idqMu9LUk0XGqG7StMys5n0VatMjhqOKrZF67wYEgGlaPYTRfpHEDMCPDLB/myYC
OpkxBG45CHzNz2tABRxsfPXN4+8bZpz0y6LUoeQD/ZMcMmZ2sA==
-----END CERTIFICATE-----
11 changes: 11 additions & 0 deletions example.csr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-----BEGIN CERTIFICATE REQUEST-----
MIIBlDCB/gIBADBVMQswCQYDVQQGEwJERTELMAkGA1UECAwCQkUxDzANBgNVBAcM
BkJlcmxpbjESMBAGA1UECgwJTXlDb21wYW55MRQwEgYDVQQDDAtlc3AzMi5sb2Nh
bDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAr9pj2OFF8QCB+7cp5M1DVPYK
yEM/XZ5t6eYs+edUbzfQdCEwsh7WK039/S09OC5Ri04GBRL3DbN5kR2bpqp6ySSR
XnlaebMiEY2D9y7CX/On3w1s6xnhHByOnl20vnDxSeUiwrw+wWe1FYdA62GBoofd
jPIaDrlm08oPXf9kZdsCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4GBAH3cG2NfDS4+
bwqtP8Jignr/jUxlPnlVJj5dlnry0DYvf+RZBpVMjzmbm3L/lEg/UQeCk6DwBEEZ
LacF8sjT/cMm6r3362SFFK/UfmgzpRL8EJIrNAkjEEcDwwb/iEMV31rirGeyTKS9
0REzeyVcH/Iazg1HJsUQIvcuc9lNusli
-----END CERTIFICATE REQUEST-----
16 changes: 16 additions & 0 deletions example.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-----BEGIN PRIVATE KEY-----
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAK/aY9jhRfEAgfu3
KeTNQ1T2CshDP12ebenmLPnnVG830HQhMLIe1itN/f0tPTguUYtOBgUS9w2zeZEd
m6aqeskkkV55WnmzIhGNg/cuwl/zp98NbOsZ4Rwcjp5dtL5w8UnlIsK8PsFntRWH
QOthgaKH3YzyGg65ZtPKD13/ZGXbAgMBAAECgYAYgZm6hqJFlKmIl5zp+sTwWR1l
jSGOfV6Z4u7PoLI+kYumM13i5LM587N6jcxjQOkyPZxPJrZxHVrKo1KmpklX9VAD
4BZzpBhDgWAsBW0xjx2DLPAkWQHsP0P71XSWonukZmyV9JKpX5/0zxuMKtc7AHAw
myWKq8xVMKQf4YbZKQJBAOMBp8k5xkK7t+WtGfkwTu1zweVAkjVx4YH+bjftn/fR
wFmak+yyuYb52kaT1rPHiWz4ABQW4YrYvB7qYejKyE0CQQDGUDEfAZEkjX3aTYFA
3FjUOUNn0ip/hKMKAUJa2u8ScNQE/L/5jAhDIuADMiHtEGhT55+N0FW0Oya/4MXG
hnrHAkBcucZhqdnUVH1vsd+ULClxUQF4tYGDlzr4MIexDL11KxaZA009OFwUSGbi
wWzIDs+R1VOi4R3L63AcaL0JrBtZAkAe4hIkP/w4cwhsXLGKRkZXFmvW2TXhEejK
ABQzTfD5MDT0aeADnrkSq3WzSbVa07lLh8CjNxSBssyACSMDnaG1AkEAxGfepmeQ
zmTCYXY2SJI2M8g5VfZTMqOawmnZfC8M9j5+/Co6smcYZnP7UrQ2ISuMCUpQHkMh
GZAnN8lsCt08PQ==
-----END PRIVATE KEY-----
9 changes: 9 additions & 0 deletions exampleca.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[ req ]
distinguished_name = req_distinguished_name
prompt = no
[ req_distinguished_name ]
C = DE
ST = BE
L = Berlin
O = MyCompany
CN = myca.local
15 changes: 15 additions & 0 deletions exampleca.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-----BEGIN CERTIFICATE-----
MIICUjCCAbugAwIBAgIUfQMxSuNId0LHIA0ws5n78ThqLtIwDQYJKoZIhvcNAQEL
BQAwVDELMAkGA1UEBhMCREUxCzAJBgNVBAgMAkJFMQ8wDQYDVQQHDAZCZXJsaW4x
EjAQBgNVBAoMCU15Q29tcGFueTETMBEGA1UEAwwKbXljYS5sb2NhbDAeFw0yNDA3
MDkxMDExMDdaFw0zNDA3MDcxMDExMDdaMFQxCzAJBgNVBAYTAkRFMQswCQYDVQQI
DAJCRTEPMA0GA1UEBwwGQmVybGluMRIwEAYDVQQKDAlNeUNvbXBhbnkxEzARBgNV
BAMMCm15Y2EubG9jYWwwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAPIbBuD+
Q6dBjRK7bac9dpv4wp7o34S4hAsDUP8I/RVDB5BLaaAcxJKc9oaRcamxK8Ed3ybw
V8E3sI8s0+qmZ4UO+OxozGZqWSZGhzIN+2tL7UasRjysAIzfhDWTBGc+JzJoAHTs
Mq7F3uhE2vsjhZuo3cZ4kEk0hRIvnxpwAexVAgMBAAGjITAfMB0GA1UdDgQWBBTC
qpgyA21IXR4Maq4makkkGgy66TANBgkqhkiG9w0BAQsFAAOBgQA2xzOMllZTtSzR
4gcNsFVyIv9ddtFJhIg5UBBZgSPucjq+lfwnGCQl8HNl7k8RGtDOPKaRLYVlG20t
ZtBJJm+RODjRQQ+1AXwkS+/VodUhKXr4utgLMo8wtKUVUfNCwJ9Oa3lScgJVvEmT
y/qVdB3tFEjBEcGi4rm2HQK8ghZDhA==
-----END CERTIFICATE-----
16 changes: 16 additions & 0 deletions exampleca.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-----BEGIN PRIVATE KEY-----
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAPIbBuD+Q6dBjRK7
bac9dpv4wp7o34S4hAsDUP8I/RVDB5BLaaAcxJKc9oaRcamxK8Ed3ybwV8E3sI8s
0+qmZ4UO+OxozGZqWSZGhzIN+2tL7UasRjysAIzfhDWTBGc+JzJoAHTsMq7F3uhE
2vsjhZuo3cZ4kEk0hRIvnxpwAexVAgMBAAECgYEA3cbIPF5uls5Dbn9m6SYyepob
nfnwluF3g6ccESOowktOqG2ManEv2KYUZhzho/J6BENa4Y6UtJhREjacQX0BoWeD
EwZ5QQBmgPK3FTlLStskGtp13zmotgSabmtP9laCu236XvCK3x+a/ylU8qgbnBbM
xbRXfFnRze0eCo9WCpkCQQD5qCgxb1IK1pIlwSuPOSP0uP6ydeFw5cYspLAGPpUH
3rZnKWj2aXPIGMN/ciQowvXoj9l1JgIEPrsrbgFLasTTAkEA+EHBB03mrclpHRSf
0aUrlkkS26DhKhlacNxRspywjnr2/4/FJxCFh0Lt7EYAOjYUcwqBgcBT4/YJYKQQ
U73xNwJAWO8wMjwHq9i4Az8G92RRjLIB+SzI/GC98dVQ50iP6lfJ/oHf5De4iQVZ
TyMoAmVBGHF186dwfHakUlpDl8wXBQJAQl3RrJI2yN6/KvcIgpMVQ+flErG/f/Gn
K+S6MnWQ/YYB4fAdVIQmLjLGSBOum+E5NkfotzcjNh3gA+XYN4rfoQJAY57SfWHe
4UPOuCcUs3/WJ16qfT2PrnFy80AD9L0dj8ZKe6LDRAVGHDTQ+aueo0cOGEDBdFhS
87ZipaBGxBV6Pw==
-----END PRIVATE KEY-----
1 change: 1 addition & 0 deletions exampleca.srl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
02
2 changes: 2 additions & 0 deletions examples/Websocket-Chat/Websocket-Chat.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
#include <sstream>

// TODO: Configure your WiFi here
#ifndef WIFI_SSID
#define WIFI_SSID "<your ssid goes here>"
#define WIFI_PSK "<your pre-shared key goes here>"
#endif

// Max clients to be connected to the chat
#define MAX_CLIENTS 4
Expand Down
1 change: 1 addition & 0 deletions extras/create_cert.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
set -e
set -x
#------------------------------------------------------------------------------
# cleanup any previously created files
rm -f exampleca.* example.* cert.h private_key.h
Expand Down
8 changes: 4 additions & 4 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "esp32_https_server",
"name": "esp32_idf5_https_server",
"keywords": "communication, esp32, http, https, server, ssl, tls, webserver, websockets",
"description": "Alternative ESP32 Webserver implementation for the ESP32, supporting HTTPS and HTTP. The library provides TLS support and simultaneous connections. It can be used to run an HTTP or HTTPS server, or both in parallel. The server's resources are defined through handler and middleware functions, giving an easy start to everyone who has worked with frameworks like Express or Servlets before.",
"description": "Alternative ESP32 Webserver implementation for the ESP32, supporting HTTPS and HTTP. The library provides TLS support and simultaneous connections. It can be used to run an HTTP or HTTPS server, or both in parallel. The server's resources are defined through handler and middleware functions, giving an easy start to everyone who has worked with frameworks like Express or Servlets before. This fork is compatible with ESP-IDF 5.0 or later.",
"repository":
{
"type": "git",
"url": "https://github.com/fhessel/esp32_https_server.git"
"url": "https://github.com/jackjansen/esp32_idf5_https_server.git"
},
"license": "MIT",
"version": "1.0.0",
"version": "1.1.1",
"frameworks": "arduino",
"platforms": ["espressif32"]
}
10 changes: 5 additions & 5 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name=ESP32_HTTPS_Server
version=1.0.0
name=ESP32_IDF5_HTTPS_Server
version=1.1.1
author=Frank Hessel <frank@fhessel.de>
maintainer=Frank Hessel <frank@fhessel.de>
sentence=Alternative ESP32 Webserver implementation for the ESP32, supporting HTTPS and HTTP.
maintainer=Jack Jansen <Jack.Jansen@cwi.nl>
sentence=Alternative ESP32 Webserver implementation for the ESP32, supporting HTTPS and HTTP. Compatible with ESP-IDF 5.0 or later.
paragraph=The library provides TLS support and simultaneous connections. It can be used to run an HTTP or HTTPS server, or both in parallel. The server's resources are defined through handler and middleware functions, giving an easy start to everyone who has worked with frameworks like Express or Servlets before.
category=Communication
url=https://github.com/fhessel/esp32_https_server
url=https://github.com/jackjansen/esp32_idf5_https_server
architectures=esp32
includes=HTTPSServer.hpp,HTTPRequest.hpp,HTTPResponse.hpp
45 changes: 45 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[platformio]


[env]
framework = arduino
monitor_speed = 115200
upload_speed = 460800
build_type = debug
monitor_filters = esp32_exception_decoder
upload_port = /dev/cu.usbmodem11201
build_src_filter =
+<*.cpp>
+<../examples/Websocket-Chat/*.cpp>

[credentials]
wifi_ssids =
-DWIFI_SSID=\"${sysenv.WIFI_SSID}\"
-DWIFI_PSK=\"${sysenv.WIFI_PASSWORD}\"

[env:custom-server]
;platform = espressif32@6.7.0 ; works fine with https

; development fails to compile:
platform = https://github.com/pioarduino/platform-espressif32.git#develop
; stable:
;platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.03/platform-espressif32.zip

; board = m5stack-cores3
board = esp32-s3-devkitc-1-32MB-8MB

upload_protocol = esptool
debug_tool = esp-builtin
debug_init_break = tbreak app_main
debug_speed = 10000
build_flags =
-Isrc
-ggdb3 -O0
-DCORE_DEBUG_LEVEL=5
${credentials.wifi_ssids}
-Dmbedtls_sha1_ret=mbedtls_sha1
lib_deps =
; https://github.com/mlesniew/PicoWebsocket.git
; m5stack/M5Unified@0.1.16


6 changes: 3 additions & 3 deletions src/ConnectionContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#include <IPAddress.h>

// Required for SSL
#include "openssl/ssl.h"
#undef read

//#include "openssl/ssl.h"
//#undef read
#include <esp_tls.h>
namespace httpsserver {

class WebsocketHandler;
Expand Down
5 changes: 3 additions & 2 deletions src/HTTPConnection.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "HTTPConnection.hpp"

#include "mbedtls/base64.h"
#include "mbedtls/sha1.h"
namespace httpsserver {

HTTPConnection::HTTPConnection(ResourceResolver * resResolver):
Expand Down Expand Up @@ -664,7 +665,7 @@ void handleWebsocketHandshake(HTTPRequest * req, HTTPResponse * res) {
std::string websocketKeyResponseHash(std::string const &key) {
std::string newKey = key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
uint8_t shaData[HTTPS_SHA1_LENGTH];
esp_sha(SHA1, (uint8_t*)newKey.data(), newKey.length(), shaData);
mbedtls_sha1((uint8_t*)newKey.data(), newKey.length(), shaData);

// Get output size required for base64 representation
size_t b64BufferSize = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/HTTPConnection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

#include <string>
#include <mbedtls/base64.h>
#include <hwcrypto/sha.h>
#include <mbedtls/sha1.h>
#include <sha/sha_parallel_engine.h>
#include <functional>

// Required for sockets
Expand Down
3 changes: 2 additions & 1 deletion src/HTTPResponse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
#undef write
#include <vector>

#include <openssl/ssl.h>
//#include <openssl/ssl.h>
#include <esp_tls.h>

#include "util.hpp"

Expand Down
Loading