Issue 1:
after upgarde to 2.12.3 under win10, below issue is encountered, any suggestion?

File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\sessions.py", line 535, in post

return self.request('POST', url, data=data, json=json, **kwargs)

File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\sessions.py", line 488, in request

resp = self.send(prep, **send_kwargs)

File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\sessions.py", line 609, in send

r = adapter.send(request, **kwargs)

File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\adapters.py", line 423, in send

timeout=timeout

File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\packages\urllib3\connectionpool.py", line 594, in urlopen

chunked=chunked)

File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\packages\urllib3\connectionpool.py", line 350, in _make_request

self._validate_conn(conn)

File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\packages\urllib3\connectionpool.py", line 835, in _validate_conn

conn.connect()

File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\packages\urllib3\connection.py", line 330, in connect

cert = self.sock.getpeercert()

File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\packages\urllib3\contrib\pyopenssl.py", line 324, in getpeercert

'subjectAltName': get_subj_alt_name(x509)

File "d:\Anaconda3\lib\site-packages\requests-2.12.3-py3.5.egg\requests\packages\urllib3\contrib\pyopenssl.py", line 171, in get_subj_alt_name

ext = cert.extensions.get_extension_for_class(

AttributeError: 'Extensions' object has no attribute 'get_extension_for_class'

Issue 2:
This occurred after I upgraded form 2.11.1 to 2.12.1. The error occurs arbitrarily for the URLs I tried.

requests.get('http://google.com') # works

requests.get('http://www.google.com') # works

requests.get('https://google.com') # does not work

requests.get('https://www.google.com') # does not work

requests.get('http://amazon.com') # sometimes works

requests.get('http://www.amazon.com') # does not work

requests.get('https://amazon.com') # does not work

requests.get('https://www.amazon.com') # does not work

Below is the error:

/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.pyc in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
348 # Trigger any extra validation we need to do.
349 try:
--> 350 self._validate_conn(conn)
351 except (SocketTimeout, BaseSSLError) as e:
352 # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout.

/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.pyc in _validate_conn(self, conn)
833 # Force connect early to allow us to validate the connection.
834 if not getattr(conn, 'sock', None): # AppEngine might not have `.sock`
--> 835 conn.connect()
836
837 if not conn.is_verified:

/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connection.pyc in connect(self)
328 elif context.verify_mode != ssl.CERT_NONE \
329 and self.assert_hostname is not False:
--> 330 cert = self.sock.getpeercert()
331 if not cert.get('subjectAltName', ()):
332 warnings.warn((

/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/contrib/pyopenssl.pyc in getpeercert(self, binary_form)
322 (('commonName', x509.get_subject().CN),),
323 ),
--> 324 'subjectAltName': get_subj_alt_name(x509)
325 }
326

/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/contrib/pyopenssl.pyc in get_subj_alt_name(peer_cert)
169 # faster than looping in Python)
170 try:
--> 171 ext = cert.extensions.get_extension_for_class(
172 x509.SubjectAlternativeName
173 ).value

AttributeError: 'Extensions' object has no attribute 'get_extension_for_class'

Tried it on Ubuntu/Python 2.7.10 and macOS/Python 2.7.11. I have OpenSSL 1.0.2 for both. Same error on both.