The package only works if I manually set REQUESTS_CA_BUNDLE
On my system (Windows 10, Python 3.9.9, custom corporate root certificate) I get SSLError
every time I try to make a request with requests
library. Installing python-certifi-win32
does not change anything.
However, If I (as one does) copy and paste this code from stackoverflow:
if sys.platform == 'win32':
import certifi_win32
os.environ['REQUESTS_CA_BUNDLE'] = certifi_win32.wincerts.where()
certifi_win32.generate_pem()
everything comes alive and SSLErrors abate. The stackverflow question in question is about a specific packaging edge case, but on my system I have to apply this fix it anywhere, in any script where I want requests
to function.