diff --git a/test/with_dummyserver/test_https.py b/test/with_dummyserver/test_https.py index 6e558d3561..082ede96f8 100644 --- a/test/with_dummyserver/test_https.py +++ b/test/with_dummyserver/test_https.py @@ -38,6 +38,7 @@ SystemTimeWarning, InsecurePlatformWarning, MaxRetryError, + ProtocolError, ) from urllib3.packages import six from urllib3.util.timeout import Timeout @@ -102,8 +103,11 @@ def test_client_no_intermediate(self): 'unknown Cert Authority' in str(e) or # https://github.com/urllib3/urllib3/issues/1422 'connection closed via error' in str(e) or - 'WSAECONNRESET' in str(e) or - 'An existing connection was forcibly closed by the remote host' in str(e)): + 'WSAECONNRESET' in str(e)): + raise + except ProtocolError as e: + # https://github.com/urllib3/urllib3/issues/1422 + if not ('An existing connection was forcibly closed by the remote host' in str(e)): raise def test_verified(self):