diff --git a/AUTHORS.rst b/AUTHORS.rst index 2fae296674..d31983438a 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -125,3 +125,4 @@ Patches and Suggestions - Dmitry Medvinsky - Bryce Boe @bboe - Colin Dunklau @cdunklau +- Hugo Osvaldo Barrera @hobarrera diff --git a/requests/__init__.py b/requests/__init__.py index 1ea4aff4e0..2dd194b02d 100644 --- a/requests/__init__.py +++ b/requests/__init__.py @@ -48,6 +48,12 @@ __license__ = 'Apache 2.0' __copyright__ = 'Copyright 2013 Kenneth Reitz' +# Attempt to enable urllib3's SNI support, if possible +try: + from requests.packages.urllib3.contrib import pyopenssl + pyopenssl.inject_into_urllib3() +except ImportError: + pass from . import utils from .models import Request, Response, PreparedRequest diff --git a/setup.py b/setup.py index 3425a41e06..2b93ba9efd 100755 --- a/setup.py +++ b/setup.py @@ -20,6 +20,7 @@ 'requests.packages.charade', 'requests.packages.urllib3', 'requests.packages.urllib3.packages', + 'requests.packages.urllib3.contrib', 'requests.packages.urllib3.packages.ssl_match_hostname' ]