Commit 34d5a9a2 authored by Steffen Prince's avatar Steffen Prince Committed by sprin

Port Python 2.7.9 ssl.py

Resolves #477.

In Python 2.7.9, we have new SSL interfaces, that are not quite
the old Python 2 interfaces, nor the same as the Python 3 interfaces.

This creates a new SSL module, _sslgte279.py, for Python 2 versions
greater than or equal 2.7.9, ported from Python 2.7.9's ssl.py:
https://hg.python.org/cpython/file/648dcafa7e5f/Lib/ssl.py.

The process of porting was done by starting with gevent's ssl3.py and
backporting Python 2.7.9's ssl.py.

Fixes these tests under Python 2.7.9:

 - /usr/local/bin/python -u -m monkey_test --Event test_urllib2net.py
 - /usr/local/bin/python -u -m monkey_test test_urllib2net.py
 - /usr/local/bin/python -u test__ssl.py

No new test failures. Still failing since 72119c8c:

 - /usr/local/bin/python -u -m monkey_test --Event test_ssl.py
 - /usr/local/bin/python -u -m monkey_test test_ssl.py
 - /usr/local/bin/python -u test__pywsgi.py
 - /usr/local/bin/python -u test__makefile_ref.py
 - /usr/local/bin/python -u test__socket.py
 - /usr/local/bin/python -u test___example_servers.py
 - /usr/local/bin/python -u -m monkey_test --Event test_ftplib.py
 - /usr/local/bin/python -u test__socket_ssl.py
 - /usr/local/bin/python -u -m monkey_test test_ftplib.py
 - /usr/local/bin/python -u test__all__.py

In addition, basic HTTPS requests were tested with urllib3==1.10.2
and requests==2.6.0.
parent 72119c8c
This diff is collapsed.
......@@ -26,6 +26,13 @@ __all__ = ['getcurrent',
'Hub',
'Waiter']
# Sniff Python > 2.7.9 for new SSL interfaces
# If True, Python is greater than or equal to 2.7.9 (but not Python 3).
PYGTE279 = (
sys.version_info[0] == 2
and sys.version_info[1] >= 7
and sys.version_info[2] >= 9
)
PY3 = sys.version_info[0] >= 3
PYPY = hasattr(sys, 'pypy_version_info')
......
from gevent.hub import PY3
from gevent.hub import PYGTE279
if PY3:
if PYGTE279:
from gevent import _sslgte279 as _source
elif PY3:
from gevent import _ssl3 as _source
else:
from gevent import _ssl2 as _source
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment