tests/net_inet/tls_text_errors.py: Tweak test for newer CPython version.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2024-05-27 13:56:04 +10:00
parent e1111d873a
commit a34b5d1b79

View File

@ -17,10 +17,12 @@ def test(addr):
# mbedtls produces "mbedtls -0x7200: SSL - An invalid SSL record was received" # mbedtls produces "mbedtls -0x7200: SSL - An invalid SSL record was received"
# axtls produces "RECORD_OVERFLOW" but also prints "TLS buffer overflow,..." # axtls produces "RECORD_OVERFLOW" but also prints "TLS buffer overflow,..."
# CPython produces "[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1108)" # CPython produces "[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1108)"
# CPython newer version produces "[SSL] record layer failure (_ssl.c:1000)"
ok = ( ok = (
"SSL_INVALID_RECORD" in str(e) "SSL_INVALID_RECORD" in str(e)
or "RECORD_OVERFLOW" in str(e) or "RECORD_OVERFLOW" in str(e)
or "wrong version" in str(e) or "wrong version" in str(e)
or "record layer failure" in str(e)
) )
print("wrap:", ok) print("wrap:", ok)
if not ok: if not ok: