Mercurial > hg-stable
changeset 51769:8fe7c0e1df1e
dummysmtpd: fix EOF handling on newer versions of OpenSSL
Explanations inline.
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Mon, 22 Jul 2024 14:42:54 +0200 |
parents | 57f0b86611c7 |
children | 832a1aeb576f |
files | tests/dummysmtpd.py tests/test-patchbomb-tls.t |
diffstat | 2 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/dummysmtpd.py Mon Jul 22 14:19:12 2024 +0200 +++ b/tests/dummysmtpd.py Mon Jul 22 14:42:54 2024 +0200 @@ -31,8 +31,15 @@ def mocksmtpserversession(conn, addr): conn.send(b'220 smtp.example.com ESMTP\r\n') - line = conn.recv(1024) + try: + # Newer versions of OpenSSL raise on EOF + line = conn.recv(1024) + except ssl.SSLError: + log('no hello: EOF\n') + return + if not line.lower().startswith(b'ehlo '): + # Older versions of OpenSSl don't raise log('no hello: %s\n' % line) return