コード例 #1
0
ファイル: jinja_cfg.py プロジェクト: openstack/neutron-lbaas
def _get_primary_cn(tls_cert):
    """Retrieve primary cn for TLS certificate

    :param tls_cert: the TLS certificate
    :returns: primary cn of the TLS certificate
    """
    return cert_parser.get_host_names(tls_cert)['cn']
コード例 #2
0
 def test_alt_subject_name_parses(self):
     hosts = cert_parser.get_host_names(ALT_EXT_CRT)
     self.assertEqual('www.cnfromsubject.org', hosts['cn'])
     self.assertEqual('www.hostfromdnsname1.com', hosts['dns_names'][0])
     self.assertEqual('www.hostfromdnsname2.com', hosts['dns_names'][1])
     self.assertEqual('www.hostfromdnsname3.com', hosts['dns_names'][2])
     self.assertEqual('www.hostfromdnsname4.com', hosts['dns_names'][3])
コード例 #3
0
def _get_primary_cn(tls_cert):
    """Retrieve primary cn for TLS certificate

    :param tls_cert: the TLS certificate
    :returns: primary cn of the TLS certificate
    """
    return cert_parser.get_host_names(tls_cert)['cn']
コード例 #4
0
 def test_alt_subject_name_parses(self):
     hosts = cert_parser.get_host_names(ALT_EXT_CRT)
     self.assertEqual(hosts['cn'], 'www.CNFromSubject.org')
     self.assertEqual(hosts['dns_names'][0], 'www.hostFrom_dNSName1.com')
     self.assertEqual(hosts['dns_names'][1], 'www.hostFrom_dNSName2.com')
     self.assertEqual(hosts['dns_names'][2], 'www.hostFrom_dNSName3.com')
     self.assertEqual(hosts['dns_names'][3], 'www.hostFrom_dNSName4.com')
コード例 #5
0
 def test_alt_subject_name_parses(self):
     hosts = cert_parser.get_host_names(ALT_EXT_CRT)
     self.assertEqual("www.CNFromSubject.org", hosts["cn"])
     self.assertEqual("www.hostFrom_dNSName1.com", hosts["dns_names"][0])
     self.assertEqual("www.hostFrom_dNSName2.com", hosts["dns_names"][1])
     self.assertEqual("www.hostFrom_dNSName3.com", hosts["dns_names"][2])
     self.assertEqual("www.hostFrom_dNSName4.com", hosts["dns_names"][3])
コード例 #6
0
 def test_alt_subject_name_parses(self):
     hosts = cert_parser.get_host_names(ALT_EXT_CRT)
     self.assertEqual('www.cnfromsubject.org', hosts['cn'])
     self.assertEqual('www.hostfromdnsname1.com', hosts['dns_names'][0])
     self.assertEqual('www.hostfromdnsname2.com', hosts['dns_names'][1])
     self.assertEqual('www.hostfromdnsname3.com', hosts['dns_names'][2])
     self.assertEqual('www.hostfromdnsname4.com', hosts['dns_names'][3])
コード例 #7
0
 def test_alt_subject_name_parses(self):
     hosts = cert_parser.get_host_names(ALT_EXT_CRT)
     self.assertEqual(hosts['cn'], 'www.CNFromSubject.org')
     self.assertEqual(hosts['dns_names'][0], 'www.hostFrom_dNSName1.com')
     self.assertEqual(hosts['dns_names'][1], 'www.hostFrom_dNSName2.com')
     self.assertEqual(hosts['dns_names'][2], 'www.hostFrom_dNSName3.com')
     self.assertEqual(hosts['dns_names'][3], 'www.hostFrom_dNSName4.com')
コード例 #8
0
 def _get_primary_cn(self, tls_cert):
     """Returns primary CN for Certificate."""
     return cert_parser.get_host_names(tls_cert.get_certificate())['cn']
コード例 #9
0
 def _get_primary_cn(self, tls_cert):
     """Returns primary CN for Certificate."""
     return cert_parser.get_host_names(tls_cert.get_certificate())['cn']