From 47380c9fe3aa91d7880c2a1089bcef4ccce2e3bd Mon Sep 17 00:00:00 2001 From: Karoline Pauls Date: Sat, 17 May 2025 19:20:23 +0100 Subject: [PATCH] docs: SSL context performance issues --- docs/advanced/ssl.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/advanced/ssl.md b/docs/advanced/ssl.md index da40ed28..3aa8d116 100644 --- a/docs/advanced/ssl.md +++ b/docs/advanced/ssl.md @@ -99,3 +99,7 @@ If you do need to make HTTPS connections to a local server, for example to test ctx = ssl.create_default_context(cafile="client.pem") client = httpx.Client(verify=ctx) ``` + +### SSL context performance issues + +It takes about 20ms to create an SSL context. While the default SSL context is cached, this issue is impactful if creating a number of clients (contexts) with a custom SSL context. It is recommended to reuse the same client in this case.