pyinstaller compiled file has ssl issue, error: 185090050

大兔子大兔子 提交于 2019-12-04 15:33:36

I had the same problem when I tried to connect to google drive with OAuth 2.0. I have searched and found that the solution is changing in httplib2 in init.py this line

CA_CERTS = os.path.join(
    os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt")

by this other

CA_CERTS = os.path.join(os.path.dirname(sys.executable), "cacerts.txt")

then build the .exe and put the "cacerts.txt" file in the same folder of the .exe.

It worked for me, I hope it does for you too!

Solved my own problem! After each line of this in my code:

    client = oauth.Client(consumer)

I added this line:

    client.ca_certs = os.path.join(os.path.dirname(__file__),'cacert.pem')

Then I just kept the 'cacert.pem' file with my exe. Super easy.

You have to find the cacerts.txt file in your system and make sure you have permissions to read it.

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