8000 The handshake operation timed out - On requests https requests · Issue #1433 · encode/httpx · GitHub
[go: up one dir, main page]

Skip to content
The handshake operation timed out - On requests https requests #1433
@FlorianREGAZ

Description

@FlorianREGAZ

Checklist

Wasn't able to find help in Issues or a solution Pull requests.

Describe the bug

Error while requesting on any site via HTTPS.
HTTP works, but I need HTTPS for what I'm planning to do.

To reproduce

# User/Pass Proxy
proxy = {
    'http://': 'http://{0}:{1}@{2}:{3}'.format(splitted[2], splitted[3], splitted[0], splitted[1]),
    'https://': 'https://{0}:{1}@{2}:{3}'.format(splitted[2], splitted[3], splitted[0], splitted[1])
}
c = httpx.Client(proxies=proxy)
response = c.get("https://ipinfo.io/json").text
print(response)

Actual behavior

Error:

httpx.ProxyError: _ssl.c:1091: The handshake operation timed out

Debugging material

Traceback (most recent call last):
  File "D:\x\venv\lib\site-packages\httpcore\_sync\http_proxy.py", line 217, in _tunnel_request
    ) = proxy_connection.request(
  File "D:\x\venv\lib\site-packages\httpcore\_sync\connection.py", line 93, in request
    self.socket = self._open_socket(timeout)
  File "D:\x\venv\lib\site-packages\httpcore\_sync\connection.py", line 119, in _open_socket
    return self.backend.open_tcp_stream(
  File "D:\x\venv\lib\site-packages\httpcore\_backends\sync.py", line 143, in open_tcp_stream
    return SyncSocketStream(sock=sock)
  File "C:\Program Files\Python38\lib\contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "D:\x\venv\lib\site-packages\httpcore\_exceptions.py", line 12, in map_exceptions
    raise to_exc(exc) from None
httpcore.ConnectTimeout: _ssl.c:1091: The handshake operation timed out
647D


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\x\venv\lib\site-packages\httpx\_exceptions.py", line 326, in map_exceptions
    yield
  File "D:\x\venv\lib\site-packages\httpx\_client.py", line 861, in _send_single_request
    (status_code, headers, stream, ext) = transport.request(
  File "D:\x\venv\lib\site-packages\httpcore\_sync\http_proxy.py", line 124, in request
    return self._tunnel_request(
  File "D:\x\venv\lib\site-packages\httpcore\_sync\http_proxy.py", line 242, in _tunnel_request
    raise ProxyError(exc)
httpcore.ProxyError: _ssl.c:1091: The handshake operation timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:/x/test.py", line 22, in <module>
    response = c.get("https://ipinfo.io/json").text
  File "D:\x\venv\lib\site-packages\httpx\_client.py", line 907, in get
    return self.request(
  File "D:\x\venv\lib\site-packages\httpx\_client.py", line 733, in request
    return self.send(
  File "D:\x\venv\lib\site-packages\httpx\_client.py", line 767, in send
    response = self._send_handling_auth(
  File "D:\x\venv\lib\site-packages\httpx\_client.py", line 805, in _send_handling_auth
    response = self._send_handling_redirects(
  File "D:\x\venv\lib\site-packages\httpx\_client.py", line 837, in _send_handling_redirects
    response = self._send_single_request(request, timeout)
  File "D:\x\venv\lib\site-packages\httpx\_client.py", line 861, in _send_single_request
    (status_code, headers, stream, ext) = transport.request(
  File "C:\Program Files\Python38\lib\contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "D:\x\venv\lib\site-packages\httpx\_exceptions.py", line 343, in map_exceptions
    raise mapped_exc(message, **kwargs) from exc  # type: ignore
httpx.ProxyError: _ssl.c:1091: The handshake operation timed out

Environment

  • OS: Windows
  • Python version: 3.8.0
  • HTTPX version: 0.16.1
  • HTTP proxy: yes - issue doesnt happen without proxy
  • Custom certificates: no

Additional context

Thanks in advance, hope anyone can help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0