Ejemplo 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'))
Ejemplo n.º 2
0
 def test_cert_mapped_address(self):
     self.assertTrue(
         SSLHandshakeDispatcher.compare_names('127.0.0.1',
                                              '::ffff:127.0.0.1'))
Ejemplo n.º 3
0
 def test_same_string(self, mock_gethostbyaddr):
     self.assertTrue(
         SSLHandshakeDispatcher.compare_names('10.0.0.1', 'example.com'))
Ejemplo n.º 4
0
def test_local_addresses(lhs, rhs):
    assert SSLHandshakeDispatcher.compare_names(lhs, rhs)
Ejemplo n.º 5
0
def test_imposter(fake_gethostbyaddr):
    assert not SSLHandshakeDispatcher.compare_names('10.0.0.1', 'example.com')
Ejemplo n.º 6
0
def test_multiple(fake_gethostbyaddr):
    assert SSLHandshakeDispatcher.compare_names('10.0.0.2', 'example.com')
Ejemplo n.º 7
0
def test_failed_mapped_address(fake_gethostbyaddr):
    assert not SSLHandshakeDispatcher.compare_names('10.0.0.1',
                                                    '::ffff:127.0.0.1')
Ejemplo n.º 8
0
 def test_cert_mapped_address(self):
     self.assertTrue(SSLHandshakeDispatcher.compare_names(
         '127.0.0.1', '::ffff:127.0.0.1'))
Ejemplo n.º 9
0
def test_same_string(fake_gethostbyaddr):
    assert SSLHandshakeDispatcher.compare_names('10.0.0.1', 'example.com')
Ejemplo n.º 10
0
 def test_imposter(self, mock_gethostbyaddr):
     self.assertFalse(SSLHandshakeDispatcher.compare_names(
         '10.0.0.1', 'example.com'))
Ejemplo n.º 11
0
 def test_imposter(self, mock_gethostbyaddr):
     self.assertFalse(SSLHandshakeDispatcher.compare_names(
         '10.0.0.1', 'example.com'))
Ejemplo n.º 12
0
 def test_multiple(self, mock_gethostbyaddr):
     self.assertTrue(SSLHandshakeDispatcher.compare_names(
         '10.0.0.2', 'example.com'))
Ejemplo 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'))
Ejemplo 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'))
Ejemplo n.º 15
0
def test_mapped_address(lhs, rhs):
    assert SSLHandshakeDispatcher.compare_names(lhs, rhs)
Ejemplo n.º 16
0
 def test_multiple(self, mock_gethostbyaddr):
     self.assertTrue(
         SSLHandshakeDispatcher.compare_names('10.0.0.2', 'example.com'))
Ejemplo n.º 17
0
 def test_same_string(self, mock_gethostbyaddr):
     self.assertTrue(SSLHandshakeDispatcher.compare_names(
         '10.0.0.1', 'example.com'))