File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ def test_validate_hostname_rejects_mismatch(self):
146146 conn ._socket = Mock ()
147147 conn ._socket .get_peer_certificate .return_value = _make_certificate ('wrong.host' )
148148
149- with self .assertRaises (Exception ):
149+ with self .assertRaises (ssl . CertificateError ):
150150 conn ._validate_hostname ()
151151
152152 def test_validate_hostname_uses_server_hostname (self ):
@@ -167,7 +167,7 @@ def test_validate_hostname_prefers_san_over_common_name(self):
167167 conn ._socket = Mock ()
168168 conn ._socket .get_peer_certificate .return_value = _make_certificate ('sni.host' , ['other.host' ])
169169
170- with self .assertRaises (Exception ):
170+ with self .assertRaises (ssl . CertificateError ):
171171 conn ._validate_hostname ()
172172
173173 def test_validate_hostname_matches_wildcard_san (self ):
You can’t perform that action at this time.
0 commit comments