'certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)

I have tried to use 'googletrans', but my comput

httpcore._exceptions.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed: self signed certificate in certificate chain
(_ssl.c:1129)

This is my code.

from googletrans import Translator
translator = Translator()
print(translator.translate('안녕하세요', src='ko', dest='en'))


Solution 1:[1]

You may check your certificate first, you can find your current certificate store by:

import certifi
certifi.where()

In my case, the result is: C:\Users\fenix\AppData\Local\Programs\Python\Python39\lib\site-packages\certifi\cacert.pem on windows, or /usr/local/lib/python3.6/site-packages/certifi/cacert.pem on Centos

And check if GlobalSign Root CA is in it, if not you need to add it.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 LingYan Meng