Slow certificate verification in Windows #3444
-
I was playing with I was making the requests like this: httpx.get(f'{self._url}/{path}', params=url_params) Upon examining the logs, I saw a big delay in
Running the same code on a Linux machine gave me this:
Note the lack of SSL anything. I was able to get it to go fast in Windows by adding httpx.get(f'{self._url}/{path}', params=url_params, verify=False) gives
Both machines are running freshly installed environments; Python 3.12 with
EDIT
Note the big delay (which still goes away with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I'd suggest instantiating a client instance so that you're not reloading the SSL context repeatedly. You could also look into different SSL configs (although ideally you shouldn't have to)...
|
Beta Was this translation helpful? Give feedback.
I changed my code to create a client as you suggested. It's significantly faster than the functional form with
verify=False
. In Linux, it seems to run 2-3x faster.In the introduction and quick start sections of the documentation, everything is using the functional form. I suppose that makes sense for the introduction so people can copy and paste stuff and do a quick test. But based on this experience, it doesn't seem like the functional form should be used in practice. Am I missing something?