pythonpython-3.xgmail-api

Gmail API - Turn off SSL Certificate Verification


I am trying to run the Gmail API example found here. Everything works fine up until I run the quickstart.py example, which gives me the error:

SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1045)

So far I have tried the two commands to disable ssl verification to see if that solves the issue but the issue persists:

conda config --set ssl_verify False 

and

set SSL_NO_VERIFY=1

I have found a general troubleshooting guide for the same error and a helpful solution to the problem here. My question is, how do I adapt the quick start example to disable client-side certificate verification like form the example by randomir:

requests.get('https://website.lo', verify=False)

I am running Windows 7 (x64) with Anaconda 5.3 (Python 3.7) and behind a corporate firewall.


Solution

  • This isn't really an answer but IT and I were able to determine the culprit to be a patch to a piece of security software running on our corporate laptops. The software has been disabled for now but they are working with the vendor (Netskope) to determine the root cause.