WARNING: This is unsafe!

One of the most annoying things is not being able to perform an https request using a third party application (e.g., twine) if you’re behind a network firewall that requires SSL verification. Luckily, you can turn this off by temporarily modifying the requests package. Open the ~/miniconda3/lib/python3.7/site-packages/requests/sessions.py and, in the Session class, set

#: SSL Verification default.
self.verify = False



Alternatively, directly from the command line, you might be able to tell the ssl Python module to temporarily disable SSL verification before running the Python program:

PYTHONHTTPSVERIFY=0 python your_script.py



Note that this is a complete hack and not usually advised especially if the site that you are visiting is not trusted. This is only here for demonstration purposes. Do not use this code!


Published

Dec 3, 2019