Include found python and version in SSL_CONTEXT warning. (#24252)

Based on issue 23642, add some info about the used python
executable and version to the error message when ssl connection
fail in a way that may be related to the version.
pull/26655/head
Adrian Likins 7 years ago committed by GitHub
parent 261c40bac7
commit 06d70ad95a

@ -571,6 +571,8 @@ def build_ssl_validation_error(hostname, port, paths, exc=None):
if not HAS_SSLCONTEXT: if not HAS_SSLCONTEXT:
msg.append('If the website serving the url uses SNI you need' msg.append('If the website serving the url uses SNI you need'
' python >= 2.7.9 on your managed machine') ' python >= 2.7.9 on your managed machine')
msg.append(' (the python executable used (%s) is version: %s)' %
(sys.executable, ''.join(sys.version.splitlines())))
if not HAS_URLLIB3_PYOPENSSLCONTEXT or not HAS_URLLIB3_SSL_WRAP_SOCKET: if not HAS_URLLIB3_PYOPENSSLCONTEXT or not HAS_URLLIB3_SSL_WRAP_SOCKET:
msg.append('or you can install the `urllib3`, `pyOpenSSL`,' msg.append('or you can install the `urllib3`, `pyOpenSSL`,'
' `ndg-httpsclient`, and `pyasn1` python modules') ' `ndg-httpsclient`, and `pyasn1` python modules')

Loading…
Cancel
Save