Closed
Description
CircuitPython version
Adafruit CircuitPython 9.0.0-beta.2-4-gf23205c822 on 2024-02-20; Adafruit Feather ESP32-S2 TFT with ESP32S2
Code/REPL
import socketpool
import wifi
from lib.adafruit_httpserver import Server, Request, Response
pool = socketpool.SocketPool(wifi.radio)
server = Server(
pool,
root_path="/static",
https=True,
certfile="cert.pem",
keyfile="key.pem",
debug=True,
)
@server.route("/")
def base(request: Request):
"""
Serve a default static plain text message.
"""
return Response(request, "Hello from the CircuitPython HTTPS Server!")
server.serve_forever(str(wifi.radio.ipv4_address), 443)
Behavior
This example code should be used with adafruit_httpserver
from PR adafruit/Adafruit_CircuitPython_HTTPServer#88.
When using the HTTP server with SSLSocket the accept()
method throws MemoryError
without additional details.
The example code works correctly on ESP32-S3 (tested on MatrixPortal S3).
Traceback (most recent call last):
File "lib/adafruit_httpserver/server.py", line 444, in poll
MemoryError:
Description
Related to:
- HTTPS Server now works on ESP32-S3 but MemoryError on Pico W and ESP32-S2 Adafruit_CircuitPython_HTTPServer#87
- HTTPS implementation Adafruit_CircuitPython_HTTPServer#88
- Fix ssl.SSLSocket bind() error checking #8962
Additional information
No response