Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL import error #102

Open
bludin opened this issue Mar 20, 2025 · 3 comments · May be fixed by #103
Open

SSL import error #102

bludin opened this issue Mar 20, 2025 · 3 comments · May be fixed by #103

Comments

@bludin
Copy link

bludin commented Mar 20, 2025

The import statement on line 15 of server.py causes an error on platforms that do not support SSL (eg M4)

@anecdata
Copy link
Member

anecdata commented Mar 20, 2025

What network are you wanting to use on the M4?

ssl is built in on devices with native wifi, and also on devices with built-in (WIZnet) Ethernet. There isn't necessarily room to put it on every device, but you can do a custom build (may need to delete other things to make room).

For ESP32SPI, see this thread:
#86 (comment)
and this PR:
adafruit/Adafruit_CircuitPython_ESP32SPI#218

@bludin
Copy link
Author

bludin commented Mar 21, 2025

I just entered this on behalf of somebody I helped in the Adafruit Circuitpython forum. I proposed a little change to the code there, that would allow for the import and use on non-SSL-enabled platforms.

@michalpokusa
Copy link
Contributor

Currently, importing the hashlib module works in a similar way.

try:
    try:
        import hashlib
    except ImportError:
        import adafruit_hashlib as hashlib
except ImportError:
    print(
        "WARNING: hashlib module not available and adafruit_hashlib not installed.",
        "Websocket support will not work.",
    )

Maybe this could be applied for ssl too? If there is a use case for adafruit_httpserver on boards that do not have ssl module, in my opinion it should not throw an error just because it is missing a module it wouldn't use either way.

@Neradoc Neradoc linked a pull request Mar 23, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants