diff --git a/CHANGELOG.md b/CHANGELOG.md index dc8ca42b..5f11dc97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## Unreleased - Fix pool timeout to account for the total time spent retrying. (#823) +- Fix synchronous TLS-in-TLS streams. (#840) ## 1.0.0 (October 6th, 2023) diff --git a/httpcore/_backends/sync.py b/httpcore/_backends/sync.py index f2dbd32a..7b7b417d 100644 --- a/httpcore/_backends/sync.py +++ b/httpcore/_backends/sync.py @@ -145,12 +145,6 @@ def start_tls( server_hostname: typing.Optional[str] = None, timeout: typing.Optional[float] = None, ) -> NetworkStream: - if isinstance(self._sock, ssl.SSLSocket): # pragma: no cover - raise RuntimeError( - "Attempted to add a TLS layer on top of the existing " - "TLS stream, which is not supported by httpcore package" - ) - exc_map: ExceptionMapping = { socket.timeout: ConnectTimeout, OSError: ConnectError,