One possible longer-term direction is to make TLS independent from Python's _ssl internals by
introducing an aiofastnet-owned TLSConfig / native TLS backend.
Right now aiofastnet needs to reuse the exact OpenSSL instance behind Python's ssl module, because it
operates on SSL_CTX* / SSL* created by Python. That makes uv-managed Python difficult to support
when _ssl is statically linked against OpenSSL and no matching libssl / libcrypto can be loaded.
A possible architecture could be:
- Keep the current backend for
ssl.SSLContext, requiring dynamically linked Python OpenSSL.
- Add a separate
TLSConfig API owned by aiofastnet.
- Compile/cache
TLSConfig into aiofastnet-managed native TLS context objects.
- Create per-connection native TLS objects from that cached context.
- Do not mix Python
_ssl objects with a different OpenSSL instance.
This would make the limitation explicit:
ssl.SSLContext path: maximum Python compatibility, but requires dynamic OpenSSL.
aiofastnet.TLSConfig path: works with uv/static Python builds, but only supports the TLS options
aiofastnet implements.
One possible longer-term direction is to make TLS independent from Python's
_sslinternals byintroducing an aiofastnet-owned
TLSConfig/ native TLS backend.Right now aiofastnet needs to reuse the exact OpenSSL instance behind Python's
sslmodule, because itoperates on
SSL_CTX*/SSL*created by Python. That makes uv-managed Python difficult to supportwhen
_sslis statically linked against OpenSSL and no matchinglibssl/libcryptocan be loaded.A possible architecture could be:
ssl.SSLContext, requiring dynamically linked Python OpenSSL.TLSConfigAPI owned by aiofastnet.TLSConfiginto aiofastnet-managed native TLS context objects._sslobjects with a different OpenSSL instance.This would make the limitation explicit:
ssl.SSLContextpath: maximum Python compatibility, but requires dynamic OpenSSL.aiofastnet.TLSConfigpath: works with uv/static Python builds, but only supports the TLS optionsaiofastnet implements.