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
Bug: SSL certificate feature breaks default no-tls setups when using reload or multiple workers #2613
Comments
ok, it's only happening when using |
Would #2612 fix this for you locally? |
I'm seeing the same thing only when using
The error:
This is with
|
@JacobCoffee Confirmed that this fixes it for me. |
https://paste.pythondiscord.com/Y2JA |
…s when using reload or multiple workers (Sourcery refactored) (#2617) 'Refactored by Sourcery' Co-authored-by: Sourcery AI <>
…s when using reload or multiple workers (#2616) * Fix 2613 Signed-off-by: Janek Nouvertné <25355197+provinzkraut@users.noreply.github.com> * fix(CLI): #2613 - SSL certificate feature breaks default no-tls setups when using reload or multiple workers (Sourcery refactored) (#2617) 'Refactored by Sourcery' Co-authored-by: Sourcery AI <> --------- Signed-off-by: Janek Nouvertné <25355197+provinzkraut@users.noreply.github.com> Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Closed by #2616 |
Description
the TLS certificate feature introduced in #2554 breaks existing installations without TLS enabled, nor TLS certificates provided.
litestar run --reload
I think it's a bug in uvicorn. the current implementation of
is_ssl
returnsTrue
if ssl_certificate and ssl_keyfile are None:https://github.com/encode/uvicorn/blob/07c2b36455b5475ff7edfa54068ff2c0581a2be1/uvicorn/config.py#L374
bool(self.ssl_keyfile or self.ssl_certfile)
is True, if ssl_keyfile or ssl_certificate is both None.But the equivalent in python
bool(None or None)
yields False?It appears that both cert parameters of
is_ssl
are type string, and notNoneType
, wich results in True, even if no cert params are provided.This should be filed against uvicorn, but I think this feature was not tested enough against existing setups?
URL to code causing the issue
No response
MCVE
# Your MCVE code here
Steps to reproduce
Screenshots
"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"
Logs
No response
Litestar Version
2.3.0
Platform
Note
While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh Litestar dashboard
The text was updated successfully, but these errors were encountered: