Skip to content

Consider aiofastnet-owned TLSConfig/native TLS backend for uv-managed Python #24

Description

@river-walras

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions