Skip to content
Myr

Use correct protocol idents when loading ssl context

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tom Christie · committed by Tom Christie · parent 0e49f23 · Browse files · 1 file+9 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−6 removed

  • other:+9 added−6 removed

1 file+9 added−6 removed

modified:httpx/dispatch/connection.py+9 added-6 removed
1import functools2import typing3import ssl45from ..concurrency import AsyncioBackend6from ..config import (7 DEFAULT_TIMEOUT_CONFIG,
65 unmodified lines
73 protocols = self.protocols if protocols is None else ProtocolConfig(protocols)7475 host = self.origin.host76 port = self.origin.port76 # Run the SSL loading in a threadpool, since it makes disk accesses.77 ssl_context = (78 await self.backend.run_in_threadpool(ssl.load_ssl_context)79 if self.origin.is_ssl80 else None81 )77 ssl_context = await self.get_ssl_context(ssl, protocols)7879 if self.release_func is None:80 on_release = None81 else:
10 unmodified lines
92 self.h11_connection = HTTP11Connection(93 reader, writer, self.backend, on_release=on_release94 )9596 async def get_ssl_context(self, ssl: SSLConfig, protocols: ProtocolConfig) -> typing.Optional[ssl.SSLContext]:97 if not self.origin.is_ssl:98 return None99100 # Run the SSL loading in a threadpool, since it may makes disk accesses.101 return await self.backend.run_in_threadpool(ssl.load_ssl_context, protocols)102103 async def close(self) -> None:104 if self.h2_connection is not None:105 await self.h2_connection.close()106 elif self.h11_connection is not None:
20 unmodified lines