This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Because migrating to python 2.7.9 requires me to update my code (or ask my clients to add cafiles to their trust store | |
# [which some people don't know how to do]), I found a way to explicitly allow insecure connections (ie. without hostname | |
# verification) using urllib2.urlopen() | |
# | |
# This gist basically involves creating an ssl.SSLContext() with some options which disable hostname verification | |
# This allows you to, for instance, add a parameter to a function which disables hostname verification. | |
import ssl | |
import urllib2 | |
import logging |