Skip to content

Instantly share code, notes, and snippets.

@aeppert
Created October 1, 2015 17:06
Show Gist options
  • Select an option

  • Save aeppert/3f22cf4e2324b649893a to your computer and use it in GitHub Desktop.

Select an option

Save aeppert/3f22cf4e2324b649893a to your computer and use it in GitHub Desktop.
Work around SSL cert validation decorator
def disable_ssl_cert_validation(func):
def inner(*args, **kwargs):
default_context = None
ret = None
try:
default_context = ssl._create_default_https_context
ssl._create_default_https_context = ssl._create_unverified_context
ret = func(*args, **kwargs)
finally:
ssl._create_default_https_context = default_context
return ret
return inner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment