SSLError(SSLError("bad handshake: SysCallError(10060, 'WSAETIMEDOUT')",),) on windows 10

I'm using python 3.5.3 on windows 10 and I get The following Error while trying to send a head or get request to a webpage:

**Here is my Traceback:**

> Traceback (most recent call last):
>   File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\contrib\pyopenssl.py", line 441, in wrap_socket
>     cnx.do_handshake()
>   File "C:\Users\aran\Anaconda3\lib\site-packages\OpenSSL\SSL.py", line 1426, in do_handshake
>     self._raise_ssl_error(self._ssl, result)
>   File "C:\Users\aran\Anaconda3\lib\site-packages\OpenSSL\SSL.py", line 1166, in _raise_ssl_error
>     raise SysCallError(errno, errorcode.get(errno))
> OpenSSL.SSL.SysCallError: (10060, 'WSAETIMEDOUT')
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>   File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
>     chunked=chunked)
>   File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request
>     self._validate_conn(conn)
>   File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 850, in _validate_conn
>     conn.connect()
>   File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connection.py", line 326, in connect
>     ssl_context=context)
>   File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\util\ssl_.py", line 329, in ssl_wrap_socket
>     return context.wrap_socket(sock, server_hostname=server_hostname)
>   File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\contrib\pyopenssl.py", line 448, in wrap_socket
>     raise ssl.SSLError('bad handshake: %r' % e)
> ssl.SSLError: ("bad handshake: SysCallError(10060, 'WSAETIMEDOUT')",)
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>   File "C:\Users\aran\Anaconda3\lib\site-packages\requests\adapters.py", line 440, in send
>     timeout=timeout
>   File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
>     _stacktrace=sys.exc_info()[2])
>   File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\util\retry.py", line 388, in increment
>     raise MaxRetryError(_pool, url, error or ResponseError(cause))
> urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='sites.google.com', port=443): Max retries exceeded with url: /a/aims-senegal.org/scipy/roots-finding-numerical-integrations-and-differential-equations (Caused by SSLError(SSLError("bad handshake: SysCallError(10060, 'WSAETIMEDOUT')",),))
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>   File "Z:/my files/projects/programing/python/courseAssist/ce_course_crawler.py", line 138, in <module>
>     response = requests.head('https://sites.google.com/a/aims-senegal.org/scipy/roots-finding-numerical-integrations-and-differential-equations')
>   File "C:\Users\aran\Anaconda3\lib\site-packages\requests\api.py", line 98, in head
>     return request('head', url, **kwargs)
>   File "C:\Users\aran\Anaconda3\lib\site-packages\requests\api.py", line 58, in request
>     return session.request(method=method, url=url, **kwargs)
>   File "C:\Users\aran\Anaconda3\lib\site-packages\requests\sessions.py", line 508, in request
>     resp = self.send(prep, **send_kwargs)
>   File "C:\Users\aran\Anaconda3\lib\site-packages\requests\sessions.py", line 618, in send
>     r = adapter.send(request, **kwargs)
>   File "C:\Users\aran\Anaconda3\lib\site-packages\requests\adapters.py", line 506, in send
>     raise SSLError(e, request=request)
> requests.exceptions.SSLError: HTTPSConnectionPool(host='sites.google.com', port=443): Max retries exceeded with url: /a/aims-senegal.org/scipy/roots-finding-numerical-integrations-and-differential-equations (Caused by SSLError(SSLError("bad handshake: SysCallError(10060, 'WSAETIMEDOUT')",),))

**And Here is my code:**
```
import requests
response = requests.head('https://sites.google.com/a/aims-senegal.org/scipy/roots-finding-numerical-integrations-and-differential-equations')
```


## System Information

```
C:\Users\aran>python -m requests.help
{
  "chardet": {
    "version": "3.0.4"
  },
  "cryptography": {
    "version": "1.7.1"
  },
  "idna": {
    "version": "2.6"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.5.3"
  },
  "platform": {
    "release": "10",
    "system": "Windows"
  },
  "pyOpenSSL": {
    "openssl_version": "100020af",
    "version": "16.2.0"
  },
  "requests": {
    "version": "2.18.4"
  },
  "system_ssl": {
    "version": "100020af"
  },
  "urllib3": {
    "version": "1.22"
  },
  "using_pyopenssl": true
}
```

The error seems to be an underlying syscall issue: specifically, the handshake timing out. What happens if you uninstall PyOpenSSL?

This is What I get:

```
Python 3.5.3 | packaged by conda-forge | (default, Jan 23 2017, 20:04:35) [MSC v.1900 64 bit (AMD64)] on win32
In[2]: import requests
response = requests.head('https://sites.google.com/a/aims-senegal.org/scipy/roots-finding-numerical-integrations-and-differential-equations')
Traceback (most recent call last):
  File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 850, in _validate_conn
    conn.connect()
  File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connection.py", line 326, in connect
    ssl_context=context)
  File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\util\ssl_.py", line 329, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "C:\Users\aran\Anaconda3\lib\ssl.py", line 385, in wrap_socket
    _context=self)
  File "C:\Users\aran\Anaconda3\lib\ssl.py", line 760, in __init__
    self.do_handshake()
  File "C:\Users\aran\Anaconda3\lib\ssl.py", line 996, in do_handshake
    self._sslobj.do_handshake()
  File "C:\Users\aran\Anaconda3\lib\ssl.py", line 641, in do_handshake
    self._sslobj.do_handshake()
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\aran\Anaconda3\lib\site-packages\requests\adapters.py", line 440, in send
    timeout=timeout
  File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\util\retry.py", line 357, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\packages\six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 850, in _validate_conn
    conn.connect()
  File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connection.py", line 326, in connect
    ssl_context=context)
  File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\util\ssl_.py", line 329, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "C:\Users\aran\Anaconda3\lib\ssl.py", line 385, in wrap_socket
    _context=self)
  File "C:\Users\aran\Anaconda3\lib\ssl.py", line 760, in __init__
    self.do_handshake()
  File "C:\Users\aran\Anaconda3\lib\ssl.py", line 996, in do_handshake
    self._sslobj.do_handshake()
  File "C:\Users\aran\Anaconda3\lib\ssl.py", line 641, in do_handshake
    self._sslobj.do_handshake()
urllib3.exceptions.ProtocolError: ('Connection aborted.', TimeoutError(10060, 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond', None, 10060, None))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\aran\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3066, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-21b5e28bac10>", line 2, in <module>
    response = requests.head('https://sites.google.com/a/aims-senegal.org/scipy/roots-finding-numerical-integrations-and-differential-equations')
  File "C:\Users\aran\Anaconda3\lib\site-packages\requests\api.py", line 98, in head
    return request('head', url, **kwargs)
  File "C:\Users\aran\Anaconda3\lib\site-packages\requests\api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\aran\Anaconda3\lib\site-packages\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\aran\Anaconda3\lib\site-packages\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\aran\Anaconda3\lib\site-packages\requests\adapters.py", line 490, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', TimeoutError(10060, 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond', None, 10060, None))
```

After running this to uninstall pyopenssl:
```
(C:\Users\aran\Anaconda3) C:\Users\aran>pip uninstall pyopenssl
Uninstalling pyOpenSSL-16.2.0:
  c:\users\aran\anaconda3\lib\site-packages\openssl
  c:\users\aran\anaconda3\lib\site-packages\pyopenssl-16.2.0-py3.5.egg-info
Proceed (y/n)? y
  Successfully uninstalled pyOpenSSL-16.2.0
```

Yup, so the remote server is timing out. That seems like a bug with the server. 

But I never get that Error from ubuntu

@aranmohyeddin  I have the same issue you mentioned here with python 3 and windows 10, I uninstalled  pyopenssl and got the exact same error, did you find any solution??the only way is to change my OS??

@Tara-Morovatdar This is from a long time ago and I don't remember much about it but I think I ended up doing it on Ubuntu, however If I recall currently I didn't have Ubuntu in my system at that time, so I must have either done it on my digital ocean VPS or on the VPS I have from my university. I find the first much more likely, assuming you are also from Iran seeing your name, and considering that the Digital ocean VPS was located outside Iran, I find it likely that the issue be related to the internet censorship we are suffering from in Iran. So I'd recommend you to try using a VPN or Tor. By the way, a few months after I had this issue I got rid of windows and installed Ubuntu, 6 months after that I switched to Archlinux, a month after installing Arch I can't imagine to ever come back to Windows again. And I have no way to express how happy I am with using Archlinux, therefore, I would strongly recommend you to go about the same path and go to Ubuntu and then to Arch, although I don't really expect it to affect your current issue. (I have to point out that I'm a heavy keyboard user(I hardy use my mouse), I don't like interfaces(I prefer to setup my system editing files rather than clicking buttons), and I don't like proprietary software if I have alternatives(Right now I only use FOSS and Cloud based Software(google docs, sharelatex, etc)) so maybe you don't like to change your OS if you find yourself so different from me from these three aspects) 

Hi AranThank you for your complete and nice answer. You are right I am from Iran but I live in germany so the problem cant be the censorship. I also dont have ubunto right now on my system but I believe that every programmer should move to ubunto in a point of time so thank you for your tips.TaraOn Aug 16, 2018 06:37, Aran Mohyeddin <notifications@github.com> wrote:@Tara-Morovatdar This is from a long time ago and I don't remember much about it but I think I ended up doing it on Ubuntu, however If I recall currently I didn't have Ubuntu in my system at that time, so I must have either done it on my digital ocean VPS or on the VPS I have from my university. I find the first much more likely, assuming you are also from Iran seeing your name, and considering that the Digital ocean VPS was located outside Iran, I find it likely that the issue be related to the internet censorship we are suffering from in Iran. So I'd recommend you to try using a VPN or Tor. By the way, a few months after I had this issue I got rid of windows and installed Ubuntu, 6 months after that I switched to Archlinux, a month after installing Arch I can't imagine to ever come back to Windows again. And I have no way to express how happy I am with using Archlinux, therefore, I would strongly recommend you to go about the same path and go to Ubuntu and then to Arch, although I don't really expect it to affect your current issue. (I have to point out that I'm a heavy keyboard user(I hardy use my mouse), I don't like interfaces(I prefer to setup my system editing files rather than clicking buttons), and I don't like proprietary software if I have alternatives(Right now I only use FOSS and Cloud based Software(google docs, sharelatex, etc)) so maybe you don't like to change your OS if you find yourself so different from me from these three aspects)

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

I got the same error I just want to get the raw data from BLE beacon
For this i have to install bluepy but it gives error 
I found that Aran and tara got the same problem 
Would any of you help me in resolving it 
Or another method to get raw data from BLE Beacon

[ERROR.txt](https://github.com/requests/requests/files/2709513/ERROR.txt)