Python requests authlib - SSLCertVerificationError CERTIFICATE_VERIFY_FAILED

ぐ巨炮叔叔 提交于 2021-02-11 15:15:41

问题


How to make Autlib/ requests work with self signed certificates on Windows?

There is documentation for how to use an environment variable to point to a CA bundle, but in my case I have struggled to make that work as I can not find an option to specify keystorepass or keyalias. Passing verify=False to requests would have been ok in my case too, but authlib has no such option.

Suggestions for alternative solutions welcome.


回答1:


The answer turned out to be hiding in plain sight.
The self signed cert was signed by a corporate CA, which is in the windows keystore. That is, the cert is recognized as valid by Chrome, IE etc.

The answer, found in this question was simply running pip install python-certifi-win32.
Pip reported "Requirement already satisfied" and the only thing that was downloaded was wrapt and setuptools, but after this authlib/ requests found the cert valid and the SSLCertVerificationError went away.



来源:https://stackoverflow.com/questions/64643325/python-requests-authlib-sslcertverificationerror-certificate-verify-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!