deadoralive icon indicating copy to clipboard operation
deadoralive copied to clipboard

SSL version issues

Open davidread opened this issue 10 years ago • 0 comments

We had some problems with some sites only talking when using particular versions of SSL. Some like v23 and some like v3. So we retry:

from requests_ssl import SSLv3Adapter
545         try:
546             response = requests.get(...)
547         except requests.exceptions.ConnectionError, e:
548             if 'SSL23_GET_SERVER_HELLO' not in str(e):
549                 raise
550             log.info('SSLv23 failed so trying again using SSLv3: %r', args)
551             requests_session = requests.Session()
552             requests_session.mount('https://', SSLv3Adapter())
553             func = {requests.get: requests_session.get,
554                     requests.post: requests_session.post}[func]
555             response = func(*args, **kwargs)

See: http://redmine.dguteam.org.uk/issues/1439

davidread avatar Oct 14 '14 15:10 davidread