# HG changeset patch # User Raphaël Gomès # Date 1721652174 -7200 # Node ID 8fe7c0e1df1ef290a6c58b6f871ee151c7046284 # Parent 57f0b86611c7f2f15d94c2fb09a20eaac6c61681 dummysmtpd: fix EOF handling on newer versions of OpenSSL Explanations inline. diff -r 57f0b86611c7 -r 8fe7c0e1df1e tests/dummysmtpd.py --- 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 diff -r 57f0b86611c7 -r 8fe7c0e1df1e tests/test-patchbomb-tls.t --- a/tests/test-patchbomb-tls.t Mon Jul 22 14:19:12 2024 +0200 +++ b/tests/test-patchbomb-tls.t Mon Jul 22 14:42:54 2024 +0200 @@ -98,7 +98,7 @@ $ wait_log "no hello:" $ cat ../log connection from * (glob) - no hello: b'' + no hello: (b''|EOF) (re) $ : > ../log With global certificates: