gh-89730: Implement support for Encrypted Client Hello (ECH) in `ssl`
The Issue & Context
Before this PR, Python's ssl module did not support Encrypted Client Hello, preventing clients from encrypting the TLS ClientHello message and exposing metadata during handshake.
Root Cause Analysis
The ssl module and underlying _ssl C extension lacked the necessary hooks and logic to construct, send, and process ECH extensions in the TLS handshake, as specified in the draft standards for ECH.
Solution Strategy & Architectural Pattern
This PR adds ECH support by extending the _ssl C module to handle ECH extension data, updating the Python ssl.py interface to expose ECH configuration options, and adding comprehensive tests and documentation. It integrates ECH key configuration, client-side encryption of ClientHello, and server-side decryption capabilities, conforming to the evolving ECH draft specifications.
Key Takeaway for Contributors
Adding support for emerging TLS extensions like ECH requires coordinated changes across C extension code, Python API layers, and test infrastructure to properly handle new handshake message structures and cryptographic operations.