espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
12.98k stars 7.29k forks source link

ESP32 library missing WebServerSecure ? #3902

Open Twilight-Logic opened 4 years ago

Twilight-Logic commented 4 years ago

Hardware:

Board: ESP32 Devkit V1, NodeMCU-32s compatible ESP32 WROOM-32 WiFi module Core Installation version: 1.0.4 IDE name: Arduino IDE 1.8.10, 1.8.12 Flash Frequency: not sure PSRAM enabled: not sure Upload Speed: 115200 Computer OS: Windows 7, Linux Mint 19.2

Description:

On the ESP32, WebServer corresponds to the ESP8266WebServer module. However, I am puzzled by the fact that when I type in #include it turns bold red as though it was a recognized module, but I then get a compiler error telling me:

WebServerSecure.h: No such file or directory Investigating further, the corresponding paths in each library were compared:

~/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WebServer

and

~/.arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/WebServer

Among other things, these paths contains a file called keywords.txt. The ESP32 version contains as follows:

Code: [Select]

#######################################

Datatypes (KEYWORD1)

#######################################

WebServer KEYWORD1 WebServerSecure KEYWORD1 HTTPMethod KEYWORD1

So clearly 'WebServerSecure' is present as a defined keyword. However, although the ESP8266 path contains ESP8266WebServerSecure.h the ESP32 path does NOT contain a corresponding WebServerSecure.h as perhaps might be expected. Furthermore, the path ~/.arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src contains WiFiServerSecure.h, whereas the equivalent ESP32 library does not.

Having had a look at the ESP32 Git repository I discover the same.

Can anyone shed any light on this? Is this a file omission from the library, or was the secure version never implemented?

Sketch:

n/a


//Change the code below by your sketch
#include <Arduino.h>
#include <WebServer.h>
#include <WebServerSecure.h>

void setup() {
}

void loop() {
}

Debug Messages:

Arduino: 1.8.12 (Linux), Board: "NodeMCU-32S, 80MHz, 921600"

Multiple libraries were found for "WiFi.h"
AR488-ESP32-test2:73:33: fatal error: WebServerSecure.h: No such file or directory
 Used: /home/johnc/.arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/WiFi
compilation terminated.
 Not used: /opt/arduino/libraries/WiFi
exit status 1
WebServerSecure.h: No such file or directory

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
stale[bot] commented 4 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

Twilight-Logic commented 4 years ago

Could we have a reply to this please?

stale[bot] commented 4 years ago

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

OBorce commented 3 years ago

+1 for WebServerSecure

Twilight-Logic commented 3 years ago

Still waiting for a reply from the devs?

luc-github commented 3 years ago

why not use https://github.com/fhessel/esp32_https_server ? there is even a compat layer : https://github.com/fhessel/esp32_https_server_compat

Twilight-Logic commented 3 years ago

Tried that. I did spend a few days re-developing my code for this library and even contacted the author because I had some issues with it which he was able to help me resolve. However, this library is completely different, MUCH bigger in terms of code size and memory usage, much more complex, and seems VERY slow. Furthermore this library is not available for the ESP8266 so this means I would have to support two separate code bases for the ESP8266 and ESP32 when surely a compatible and consistent approach could have been implemented?

luc-github commented 3 years ago

hmm https://github.com/fhessel/esp32_https_server_compat do not use same syntax for API ? EDIT: forget it I missed https://github.com/fhessel/esp32_https_server_compat#state-of-development

Twilight-Logic commented 3 years ago

I had not noticed the esp32_https_server_compat library before. Thanks for pointing it out. This does add another layer and hence further overhead and the quoted inefficiency of POST handling and support for Basic authentication only might be issues, but still worth a test perhaps. I will have a look at it.

luc-github commented 3 years ago

Looking at https://github.com/fhessel/esp32_https_server_compat#state-of-development still some work need to be done so not sure it will meet your expectation anyway

For what it worth, on my side, I have noticed arduino Esp32 core webserver is slower than esp8266 so I do not think https version will be faster - I did not tested esp32_https_server yet but got good feedback and it is actively maintained

Another solution would be to use the native http / https from IDF - it is async and looks faster as it is used for camera but API is limited and need to be ported :

https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/include/esp_http_server/esp_http_server.h / https://github.com/espressif/arduino-esp32/tree/master/tools/sdk/include/esp_https_server

stale[bot] commented 3 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

ZakCodes commented 3 years ago

I think this should stay opened

stale[bot] commented 3 years ago

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

Twilight-Logic commented 3 years ago

I think they are probably expecting us to use the incompatible fhessel library but it would be helpful to hear from the devs and have this confirmed please.

stale[bot] commented 3 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

Twilight-Logic commented 3 years ago

Ok, looks like we are not going to get any reply to this then.

stale[bot] commented 3 years ago

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

Rp777 commented 3 years ago

+1 for WebServerSecure @me-no-dev Could we have a reply on this issue?

stale[bot] commented 3 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

ZakCodes commented 3 years ago

let's keep this open

stale[bot] commented 3 years ago

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

FotoFieber commented 3 years ago

+1 for WebServerSecure

Twilight-Logic commented 3 years ago

Any update from developers?

me-no-dev commented 3 years ago

https server will be added in the next major version of Arduino

stale[bot] commented 3 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

ZakCodes commented 3 years ago

Let's keep this open

stale[bot] commented 3 years ago

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

stale[bot] commented 2 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

ZakCodes commented 2 years ago

Let's keep this open

stale[bot] commented 2 years ago

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

VojtechBartoska commented 2 years ago

Hello @Twilight-Logic , sorry for late reply. Are you able to test your issue on development version 2.0.3-RC1 to check if this is still valid? You can take a look on Docs where is explained how to choose development release version in Arduino IDE.

Twilight-Logic commented 2 years ago

Thank you for your response. I have tried both versions 1.8.19 and 2.0.0 rc5 of the IDE:

Arduino: 1.8.19 (Linux), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"

AR488-ESP32-test2:80:33: fatal error: WebServerSecure.h: No such file or directory
 Used: /home/johnc/.arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/WiFi
compilation terminated.
 Not used: /opt/arduino/libraries/WiFi
exit status 1
WebServerSecure.h: No such file or directory

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
IDE2.0 rc5
/mnt/ntfs/Data/Data/Arduino/AR488/AR488-ESP32-test2/AR488-ESP32-test2.ino:80:33: fatal error: WebServerSecure.h: No such file or directory
compilation terminated.
Multiple libraries were found for "WiFi.h"
  Used: /home/johnc/.arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/WiFi
  Not used: /opt/arduino/libraries/WiFi
Compilation error: exit status 1

I am not really sure how the version of the IDE would have a bearing on a missing component of a library though? As might be expected, both versions here report the same problem.

VojtechBartoska commented 2 years ago

Thanks, we will investigate this further.

igrr commented 2 years ago

Let's keep this feature request open.

Twilight-Logic commented 2 years ago

Than you.

(If anyone has manually added the original ESP8266 WebseverSecure library - and I have heard that is has been done - I would be interested to know how it was done? The ESP32 library seems to have a somewhat different folder structure.)

Thank you for the links quoted earlier: https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/include/esp_http_server/esp_http_server.h / https://github.com/espressif/arduino-esp32/tree/master/tools/sdk/include/esp_https_server Unfortunately these are giving me a 404 error.

I found the first one here: https://github.com/espressif/arduino-esp32/tree/master/tools/sdk/esp32/include/esp_http_server/include/esp_http_server.h The second one was here: https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/esp32c3/include/esp_https_server/include/esp_https_server.h https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/esp32s2/include/esp_https_server/include/esp_https_server.h https://github.com/espressif/arduino-esp32/blob/master/tools/sdk/esp32s3/include/esp_https_server/include/esp_https_server.h I am not sure of the significance of c3, s2 or s3? Shouldn't there also be a corresponding .cpp file?

It appreas to be possible to include this file in the project, however although it implements a HTTPS server config struct, it does not appear to implement a HTTPS server class object.

hemangjoshi37a commented 3 weeks ago

has this been solved yet ?