Django paypalrestsdk error - OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]

为君一笑 提交于 2019-12-02 09:38:18

PayPal's APIs require TLS 1.2 and my guess is that your underlying installed version of OpenSSL is a bit too old to support it.

Use the following to determine what version of OpenSSL you've got installed:

>>> import ssl
>>> print ssl.OPENSSL_VERSION
OpenSSL 1.0.2m  2 Nov 2017

If you're on anything lower than 1.0.1, you'll likely want to upgrade it using brew. In my experience, Mac OS X can have quite antiquated versions of it; I think mine was as low as 0.9.8.

Once you've upgraded OpenSSL and confirmed that in the python shell you see the new version, you can test it by running your code. If it still doesn't work, I suggest running the following to get some more fine-grained detail on the connection health:

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