Closed sergei-maertens closed 1 month ago
@pitbulk I didn't realize that requests is not a dependency yet, but IMO this is the easiest way to support this. Happy to discuss alternatives though, if you feel that adding the library is too much.
@sergei-maertens if I'm not wrong, urllib.request.urlopen accepts cafile
and capath
parameters, now that we are forcing in the new release to use python3 > 3.7, you can adapt your PR to keep using urllib.request.urlopen and accept in the method those new parameters.
Test it and let me know if works as well as requests
.
I'll look into it asap, thanks for the feedback!
edit: what would your approach be to provide the not relevant, doesn't seem like this code is called interally in many placescafile
/capath
parameters. An envvar, or something in the settings dict? I'm leaning towards the former.
@sergei-maertens do you plan to rework on the PR?
I had completely forgotten about it, sorry! I can still pick it up
@pitbulk I've updated the PR with the suggested changes, now only the stdlib is used :)
Closes #403
Using requests allows us to easily customize the CA_BUNDLE to use when verifying the server certificate, instead of having to disable SSL certificate verification alltogether.