@@ -107,7 +107,7 @@ def test_ssl_ocsp_called_withcrypto(self, request):
107
107
def test_valid_ocsp_cert_http (self ):
108
108
from redis .ocsp import OCSPVerifier
109
109
110
- hostnames = ["github.com" , "aws.amazon.com" , "ynet.co.il" , "microsoft.com" ]
110
+ hostnames = ["github.com" , "aws.amazon.com" , "ynet.co.il" ]
111
111
for hostname in hostnames :
112
112
context = ssl .create_default_context ()
113
113
with socket .create_connection ((hostname , 443 )) as sock :
@@ -124,7 +124,9 @@ def test_revoked_ocsp_certificate(self):
124
124
with socket .create_connection ((hostname , 443 )) as sock :
125
125
with context .wrap_socket (sock , server_hostname = hostname ) as wrapped :
126
126
ocsp = OCSPVerifier (wrapped , hostname , 443 )
127
- assert ocsp .is_valid () is False
127
+ with pytest .raises (ConnectionError ) as e :
128
+ assert ocsp .is_valid ()
129
+ assert "REVOKED" in str (e )
128
130
129
131
@skip_if_nocryptography ()
130
132
def test_unauthorized_ocsp (self ):
@@ -147,7 +149,9 @@ def test_ocsp_not_present_in_response(self):
147
149
with socket .create_connection ((hostname , 443 )) as sock :
148
150
with context .wrap_socket (sock , server_hostname = hostname ) as wrapped :
149
151
ocsp = OCSPVerifier (wrapped , hostname , 443 )
150
- assert ocsp .is_valid () is False
152
+ with pytest .raises (ConnectionError ) as e :
153
+ assert ocsp .is_valid ()
154
+ assert "from the" in str (e )
151
155
152
156
@skip_if_nocryptography ()
153
157
def test_unauthorized_then_direct (self ):
0 commit comments