Skip to content

Commit 4470ae9

Browse files
committed
🧪 Add OpenSSL 3.2 expectations to tests
1 parent 71989da commit 4470ae9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cheroot/_compat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
try:
99
import ssl
10+
IS_ABOVE_OPENSSL31 = ssl.OPENSSL_VERSION_INFO > (3, 1)
1011
IS_ABOVE_OPENSSL10 = ssl.OPENSSL_VERSION_INFO >= (1, 1)
1112
del ssl
1213
except ImportError:
14+
IS_ABOVE_OPENSSL31 = None
1315
IS_ABOVE_OPENSSL10 = None
1416

1517

cheroot/test/test_ssl.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import trustme
1818

1919
from .._compat import bton, ntob, ntou
20-
from .._compat import IS_ABOVE_OPENSSL10, IS_CI, IS_PYPY
20+
from .._compat import IS_ABOVE_OPENSSL10, IS_ABOVE_OPENSSL31, IS_CI, IS_PYPY
2121
from .._compat import IS_LINUX, IS_MACOS, IS_WINDOWS
2222
from ..server import HTTPServer, get_ssl_adapter_class
2323
from ..testing import (
@@ -597,7 +597,8 @@ def test_https_over_http_error(http_server, ip_addr):
597597
),
598598
).request('GET', '/')
599599
expected_substring = (
600-
'wrong version number' if IS_ABOVE_OPENSSL10
600+
'record layer failure' if IS_ABOVE_OPENSSL31
601+
else 'wrong version number' if IS_ABOVE_OPENSSL10
601602
else 'unknown protocol'
602603
)
603604
assert expected_substring in ssl_err.value.args[-1]

0 commit comments

Comments
 (0)