Esempio n. 1
0
 def test_local_addresses(self):
     self.assertTrue(SSLHandshakeDispatcher.compare_names(
         '127.0.0.1', 'example.com'))
     self.assertTrue(SSLHandshakeDispatcher.compare_names(
         '::1', 'example.com'))
     self.assertTrue(SSLHandshakeDispatcher.compare_names(
         '::ffff:127.0.0.1', 'example.com'))
Esempio n. 2
0
 def test_cert_mapped_address(self):
     self.assertTrue(
         SSLHandshakeDispatcher.compare_names('127.0.0.1',
                                              '::ffff:127.0.0.1'))
Esempio n. 3
0
 def test_same_string(self, mock_gethostbyaddr):
     self.assertTrue(
         SSLHandshakeDispatcher.compare_names('10.0.0.1', 'example.com'))
Esempio n. 4
0
def test_local_addresses(lhs, rhs):
    assert SSLHandshakeDispatcher.compare_names(lhs, rhs)
Esempio n. 5
0
def test_imposter(fake_gethostbyaddr):
    assert not SSLHandshakeDispatcher.compare_names('10.0.0.1', 'example.com')
Esempio n. 6
0
def test_multiple(fake_gethostbyaddr):
    assert SSLHandshakeDispatcher.compare_names('10.0.0.2', 'example.com')
Esempio n. 7
0
def test_failed_mapped_address(fake_gethostbyaddr):
    assert not SSLHandshakeDispatcher.compare_names('10.0.0.1',
                                                    '::ffff:127.0.0.1')
Esempio n. 8
0
 def test_cert_mapped_address(self):
     self.assertTrue(SSLHandshakeDispatcher.compare_names(
         '127.0.0.1', '::ffff:127.0.0.1'))
Esempio n. 9
0
def test_same_string(fake_gethostbyaddr):
    assert SSLHandshakeDispatcher.compare_names('10.0.0.1', 'example.com')
Esempio n. 10
0
 def test_imposter(self, mock_gethostbyaddr):
     self.assertFalse(SSLHandshakeDispatcher.compare_names(
         '10.0.0.1', 'example.com'))
Esempio n. 11
0
 def test_imposter(self, mock_gethostbyaddr):
     self.assertFalse(SSLHandshakeDispatcher.compare_names(
         '10.0.0.1', 'example.com'))
Esempio n. 12
0
 def test_multiple(self, mock_gethostbyaddr):
     self.assertTrue(SSLHandshakeDispatcher.compare_names(
         '10.0.0.2', 'example.com'))
Esempio n. 13
0
 def test_failed_mapped_address(self, mock_gethostbyaddr):
     self.assertFalse(SSLHandshakeDispatcher.compare_names(
         '10.0.0.1', '::ffff:127.0.0.1'))
Esempio n. 14
0
 def test_failed_mapped_address(self, mock_gethostbyaddr):
     self.assertFalse(
         SSLHandshakeDispatcher.compare_names('10.0.0.1',
                                              '::ffff:127.0.0.1'))
Esempio n. 15
0
def test_mapped_address(lhs, rhs):
    assert SSLHandshakeDispatcher.compare_names(lhs, rhs)
Esempio n. 16
0
 def test_multiple(self, mock_gethostbyaddr):
     self.assertTrue(
         SSLHandshakeDispatcher.compare_names('10.0.0.2', 'example.com'))
Esempio n. 17
0
 def test_same_string(self, mock_gethostbyaddr):
     self.assertTrue(SSLHandshakeDispatcher.compare_names(
         '10.0.0.1', 'example.com'))