@@ -107,7 +107,7 @@ def test_ssl_ocsp_called_withcrypto(self, request):
107107 def test_valid_ocsp_cert_http (self ):
108108 from redis .ocsp import OCSPVerifier
109109
110- hostnames = ["github.com" , "aws.amazon.com" , "ynet.co.il" , "microsoft.com" ]
110+ hostnames = ["github.com" , "aws.amazon.com" , "ynet.co.il" ]
111111 for hostname in hostnames :
112112 context = ssl .create_default_context ()
113113 with socket .create_connection ((hostname , 443 )) as sock :
@@ -124,7 +124,9 @@ def test_revoked_ocsp_certificate(self):
124124 with socket .create_connection ((hostname , 443 )) as sock :
125125 with context .wrap_socket (sock , server_hostname = hostname ) as wrapped :
126126 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 )
128130
129131 @skip_if_nocryptography ()
130132 def test_unauthorized_ocsp (self ):
@@ -147,7 +149,9 @@ def test_ocsp_not_present_in_response(self):
147149 with socket .create_connection ((hostname , 443 )) as sock :
148150 with context .wrap_socket (sock , server_hostname = hostname ) as wrapped :
149151 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 )
151155
152156 @skip_if_nocryptography ()
153157 def test_unauthorized_then_direct (self ):
0 commit comments