Permalink
Browse files

test invalid certificate fingerprints

  • Loading branch information...
t-8ch committed Mar 25, 2013
1 parent 3d3e32d commit 866280e77fa4d74c3a69370728fa463ff750c561
Showing with 12 additions and 0 deletions.
  1. +12 −0 test/with_dummyserver/test_https.py
@@ -174,6 +174,18 @@ def test_assert_invalid_fingerprint(self):
self.assertRaises(SSLError,
https_pool.request, 'GET', '/')
+ # invalid length
+ https_pool.assert_fingerprint = 'AA'
+
+ self.assertRaises(SSLError,
+ https_pool.request, 'GET', '/')
+
+ # uneven length
+ https_pool.assert_fingerprint = 'AA:A'
+
+ self.assertRaises(SSLError,
+ https_pool.request, 'GET', '/')
+
if __name__ == '__main__':
unittest.main()

0 comments on commit 866280e

Please sign in to comment.