Getting SSLError(SSLError("bad handshake: SysCallError(104, 'ECONNRESET'

- I saw that here ssl retry issue is fixed. https://github.com/urllib3/urllib3/pull/1178/files. 
- I am getting this issue after retry exhaust. This after 30 min plus starting my application.

- The code that polls the server to get next data tries every 20 seconds. (each attempt has retry enabled)

- But this issue happens after 30-40 minutes.
- we are using urllib3==1.24.1

Any pointers/suggestions for this?


Stacktrace:

ERROR:adal-python:75788bbf-6a33-4890-96bf-9553ed7e1073 - OAuth2Client:Get Token request failed
Traceback (most recent call last):
  File "/databricks/python/lib/python3.5/site-packages/urllib3/contrib/pyopenssl.py", line 453, in wrap_socket
    cnx.do_handshake()
  File "/databricks/python/lib/python3.5/site-packages/OpenSSL/SSL.py", line 1443, in do_handshake
    self._raise_ssl_error(self._ssl, result)
  File "/databricks/python/lib/python3.5/site-packages/OpenSSL/SSL.py", line 1182, in _raise_ssl_error
    raise SysCallError(errno, errorcode.get(errno))
OpenSSL.SSL.SysCallError: (104, 'ECONNRESET')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/databricks/python/lib/python3.5/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/databricks/python/lib/python3.5/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/databricks/python/lib/python3.5/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
    conn.connect()
  File "/databricks/python/lib/python3.5/site-packages/urllib3/connection.py", line 344, in connect
    ssl_context=context)
  File "/databricks/python/lib/python3.5/site-packages/urllib3/util/ssl_.py", line 344, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/databricks/python/lib/python3.5/site-packages/urllib3/contrib/pyopenssl.py", line 459, in wrap_socket
    raise ssl.SSLError('bad handshake: %r' % e)
ssl.SSLError: ("bad handshake: SysCallError(104, 'ECONNRESET')",)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/databricks/python/lib/python3.5/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/databricks/python/lib/python3.5/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/databricks/python/lib/python3.5/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/token (Caused by SSLError(SSLError("bad handshake: SysCallError(104, 'ECONNRESET')",),))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/databricks/python/lib/python3.5/site-packages/adal/oauth2_client.py", line 268, in get_token
    timeout=self._call_context.get('timeout', None))
  File "/databricks/python/lib/python3.5/site-packages/requests/api.py", line 116, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/databricks/python/lib/python3.5/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/databricks/python/lib/python3.5/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/databricks/python/lib/python3.5/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/databricks/python/lib/python3.5/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/token (Caused by SSLError(SSLError("bad handshake: SysCallError(104, 'ECONNRESET')",),))

It's likely that a peer between you and `login.microsoftonline.com` is resetting the connection because a packet isn't received in order causing the reset. It's impossible for us to discern why this is just happening for you after 30 minutes. For help debugging this, you must ask on [StackOverflow](https://stackoverflow.com)