Commit 79a90891 authored by Alexandre's avatar Alexandre
Browse files

Catch OpenSSL errors

parent e86f4bf4
......@@ -380,6 +380,10 @@ class ConnectionDoT(Connection):
if self.verbose:
print("Cannot connect")
return False
except OpenSSL.SSL.Error as e:
if self.verbose:
print(f"OpenSSL error: {', '.join(err[0][2] for err in e.args)}")
return False
# RFC 7858, section 4.2 and appendix A
self.cert = self.session.get_peer_certificate()
self.publickey = self.cert.get_pubkey()
......
......@@ -510,6 +510,19 @@ tests:
partstderr: 'Received DNS message is malformed'
stdout: "KO\n"
- exe: './homer.py'
name: '[dot][fail] Resolver with an invalid certificate'
markers:
- 'dot'
- 'fail'
args:
- '--dot'
- '-v'
- 'ns0.ldn-fai.net'
- 'framagit.org'
retcode: 1
partstdout: 'certificate verify failed'
################################################################################
# check_dot
......
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