Default ssl_ciphers to None and use OpenSSL defaults#2940
Merged
Conversation
The previous default 'TLSv1' is an OpenSSL cipher string that resolves to all ciphers available in TLS 1.0, an outdated baseline. Defaulting to None skips set_ciphers() and lets OpenSSL apply its current safe defaults, which track best practice as the library evolves.
Contributor
|
📖 Docs preview: https://4bf98090.uvicorn.pages.dev |
ssl_ciphers to None and use OpenSSL defaults
After defaulting ssl_ciphers to None, no existing test exercised the ctx.set_ciphers() path. Add a focused test that passes ssl_ciphers explicitly to keep that branch covered at 100%.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ssl_ciphers(Config,run(), and--ssl-ciphers) from"TLSv1"toNone.None,create_ssl_context()already skipsctx.set_ciphers(...), so OpenSSL's current safe defaults apply.docs/settings.mdto match.The previous
"TLSv1"value is an OpenSSL cipher string (not a protocol selector) that resolves to every cipher available in TLS 1.0 - an outdated baseline that doesn't track modern best practice. Letting OpenSSL pick its defaults keeps the cipher list current as the library evolves, without uvicorn freezing a string in place.Test plan
uv run pytest tests/test_ssl.py tests/test_config.py tests/test_main.py- 143 passeduv run ruff check uvicorn && uv run ruff format --check uvicornuv run mypy uvicornAI Disclaimer
This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.