Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Patches and Suggestions
- Bryce Boe <[email protected]> (`@bboe <https://github.com/bboe>`_)
- Colin Dunklau <[email protected]> (`@cdunklau <https://github.com/cdunklau>`_)
- Bob Carroll <[email protected]> (`@rcarz <https://github.com/rcarz>`_)
- Hugo Osvaldo Barrera <[email protected]> (`@hobarrera <https://github.com/hobarrera>`_)
- Hugo Osvaldo Barrera <[email protected]> (`@WhyNotHugo <https://github.com/WhyNotHugo>`_)
- Łukasz Langa <[email protected]>
- Dave Shawley <[email protected]>
- James Clarke (`@jam <https://github.com/jam>`_)
Expand Down
10 changes: 3 additions & 7 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ Release History
dev
---

**Improvements**

- pyOpenSSL TLS implementation is now only used if Python
either doesn't have an `ssl` module or doesn't support
SNI. Previously pyOpenSSL was unconditionally used if available.
This applies even if pyOpenSSL is installed via the
`requests[security]` extra (#5443)
**Deprecations**

- pyOpenSSL TLS is no longer patched to add extra SNI support. Python 2.7.9 or
later is now required for SNI support.

2.23.0 (2020-02-19)
-------------------
Expand Down
30 changes: 0 additions & 30 deletions requests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,6 @@ def check_compatibility(urllib3_version, chardet_version):
assert patch >= 2


def _check_cryptography(cryptography_version):
# cryptography < 1.3.4
try:
cryptography_version = list(map(int, cryptography_version.split('.')))
except ValueError:
return

if cryptography_version < [1, 3, 4]:
warning = 'Old version of cryptography ({}) may cause slowdown.'.format(cryptography_version)
warnings.warn(warning, RequestsDependencyWarning)

# Check imported dependencies for compatibility.
try:
check_compatibility(urllib3.__version__, chardet.__version__)
Expand All @@ -90,25 +79,6 @@ def _check_cryptography(cryptography_version):
"version!".format(urllib3.__version__, chardet.__version__),
RequestsDependencyWarning)

# Attempt to enable urllib3's fallback for SNI support
# if the standard library doesn't support SNI or the
# 'ssl' library isn't available.
try:
try:
import ssl
except ImportError:
ssl = None

if not getattr(ssl, "HAS_SNI", False):
from urllib3.contrib import pyopenssl
pyopenssl.inject_into_urllib3()

# Check cryptography version
from cryptography import __version__ as cryptography_version
_check_cryptography(cryptography_version)
except ImportError:
pass

# urllib3's DependencyWarnings should be silenced.
from urllib3.exceptions import DependencyWarning
warnings.simplefilter('ignore', DependencyWarning)
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def run_tests(self):
cmdclass={'test': PyTest},
tests_require=test_requirements,
extras_require={
'security': ['pyOpenSSL >= 0.14', 'cryptography>=1.3.4'],
'socks': ['PySocks>=1.5.6, !=1.5.7'],
'socks:sys_platform == "win32" and python_version == "2.7"': ['win_inet_pton'],
},
Expand Down