You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
^CTraceback (most recent call last):
File "", line 1, in
File "/home/yangyuqi/.local/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1990, in do_handshake
result = _lib.SSL_do_handshake(self._ssl)
KeyboardInterrupt
when I not called "connection.setblocking(True) ", the connection.do_handshake() is abnormal
connection.do_handshake()
Traceback (most recent call last):
File "", line 1, in
File "/home/yangyuqi/.local/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1991, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/home/yangyuqi/.local/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1675, in _raise_ssl_error
raise WantReadError()
OpenSSL.SSL.WantReadError
The text was updated successfully, but these errors were encountered:
The reason why the timeout is not working in the first fragment of code:
importOpenSSLimportsocketctx=OpenSSL.SSL.Context(OpenSSL.SSL.TLS_CLIENT_METHOD)
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection=OpenSSL.SSL.Connection(ctx, s)
connection.set_tlsext_host_name(b"www.daiyue.gov.cn")
connection.connect(("www.daiyue.gov.cn", 443)) # script blocks hereconnection.settimeout(3) # timeout is set hereconnection.setblocking(True)
connection.do_handshake()
is that the script blocks on the connect() call, so the timeout is never actually set. By putting the connect() call after setting the timeout, you get the expected TimeoutError exception.
pyOpenSSL version is: 22.0.0
openssl version is: 1.1.1j
OS: ubuntu 18.04
Python 3.6.9
when I called "connection.setblocking(True) ", the time out is invalid:
^CTraceback (most recent call last):
File "", line 1, in
File "/home/yangyuqi/.local/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1990, in do_handshake
result = _lib.SSL_do_handshake(self._ssl)
KeyboardInterrupt
when I not called "connection.setblocking(True) ", the connection.do_handshake() is abnormal
The text was updated successfully, but these errors were encountered: