Summary
Track deprecating the legacy ssl_options dictionary API in favor of passing an explicit ssl_context.
Motivation
ssl_options requires the driver to translate an ad hoc dictionary into runtime-specific TLS configuration across the connection layer and reactors. Recent SSL handling work in #938 had to preserve subtle behavior for omitted vs explicitly empty ssl_options, and also highlighted that the safer long-term API is to let callers provide a configured ssl.SSLContext directly.
Using ssl_context keeps TLS policy in the standard Python object, avoids reactor-specific option drift, and makes future TLS defaults easier to reason about.
Proposed deprecation path
- Document
ssl_context as the preferred TLS configuration API.
- Mark
ssl_options as deprecated in public docs and constructor/API references.
- Add a runtime deprecation warning when
ssl_options is supplied, while preserving existing behavior during the deprecation window.
- Keep compatibility tests for legacy
ssl_options behavior until removal is scheduled.
- In a future major release, remove
ssl_options support after a documented migration period.
Migration guidance
Users should build and pass an ssl.SSLContext with the desired CA certificates, verification mode, hostname checking, ciphers, and protocol bounds instead of passing ssl_options.
Related
Follow-up from #938.
Summary
Track deprecating the legacy
ssl_optionsdictionary API in favor of passing an explicitssl_context.Motivation
ssl_optionsrequires the driver to translate an ad hoc dictionary into runtime-specific TLS configuration across the connection layer and reactors. Recent SSL handling work in #938 had to preserve subtle behavior for omitted vs explicitly emptyssl_options, and also highlighted that the safer long-term API is to let callers provide a configuredssl.SSLContextdirectly.Using
ssl_contextkeeps TLS policy in the standard Python object, avoids reactor-specific option drift, and makes future TLS defaults easier to reason about.Proposed deprecation path
ssl_contextas the preferred TLS configuration API.ssl_optionsas deprecated in public docs and constructor/API references.ssl_optionsis supplied, while preserving existing behavior during the deprecation window.ssl_optionsbehavior until removal is scheduled.ssl_optionssupport after a documented migration period.Migration guidance
Users should build and pass an
ssl.SSLContextwith the desired CA certificates, verification mode, hostname checking, ciphers, and protocol bounds instead of passingssl_options.Related
Follow-up from #938.