Commit e6c00acf authored by Alexandre's avatar Alexandre
Browse files

Catch OpenSSL.SSL.SysCallError, fixes #27

parent c73abc61
......@@ -481,6 +481,10 @@ class ConnectionDoT(Connection):
if self.verbose:
print("Cannot connect")
return False
except OpenSSL.SSL.SysCallError as e:
if self.verbose:
error(f"OpenSSL error: {e.args[1]}", exit=False)
return False
except OpenSSL.SSL.Error as e:
if self.verbose:
print(f"OpenSSL error: {', '.join(err[0][2] for err in e.args)}")
......
......@@ -530,6 +530,22 @@ tests:
partstderr: 'Key error'
- exe: './homer.py'
name: '[dot][exception] Catch OpenSSL.SSL.SysCallError'
markers:
- 'dot'
- 'exception'
- 'forceIPv4'
args:
- '--dot'
- '--v4only'
- '--verbose'
- 'dnsotls.lab.nic.cl'
- 'wikipedia.org'
retcode: 1
partstderr: 'OpenSSL error: Unexpected EOF'
################################################################################
- exe: './homer.py'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment