本文整理汇总了Python中sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin.process_task方法的典型用法代码示例。如果您正苦于以下问题:Python CertificateInfoPlugin.process_task方法的具体用法?Python CertificateInfoPlugin.process_task怎么用?Python CertificateInfoPlugin.process_task使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin
的用法示例。
在下文中一共展示了CertificateInfoPlugin.process_task方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_ca_file_bad_file
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_ca_file_bad_file(self):
server_info = ServerConnectivityInfo(hostname='www.hotmail.com')
server_info.test_connectivity_to_server()
plugin = CertificateInfoPlugin()
with self.assertRaises(ValueError):
plugin.process_task(server_info, CertificateInfoScanCommand(ca_file='doesntexist'))
示例2: test_1000_sans_chain
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_1000_sans_chain(self):
# Ensure SSLyze can process a leaf cert with 1000 SANs
server_info = ServerConnectivityInfo(hostname='1000-sans.badssl.com')
server_info.test_connectivity_to_server()
plugin = CertificateInfoPlugin()
plugin.process_task(server_info, CertificateInfoScanCommand())
示例3: test_valid_chain
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_valid_chain(self):
server_info = ServerConnectivityInfo(hostname='www.hotmail.com')
server_info.test_connectivity_to_server()
plugin = CertificateInfoPlugin()
plugin_result = plugin.process_task(server_info, 'certinfo_basic')
self.assertTrue(plugin_result.ocsp_response)
self.assertTrue(plugin_result.is_ocsp_response_trusted)
self.assertTrue(plugin_result.is_leaf_certificate_ev)
self.assertEquals(len(plugin_result.certificate_chain), 2)
self.assertEquals(len(plugin_result.path_validation_result_list), 5)
for path_validation_result in plugin_result.path_validation_result_list:
self.assertTrue(path_validation_result.is_certificate_trusted)
self.assertEquals(len(plugin_result.path_validation_error_list), 0)
self.assertEquals(plugin_result.hostname_validation_result, X509_NAME_MATCHES_SAN)
self.assertTrue(plugin_result.is_certificate_chain_order_valid)
self.assertTrue(plugin_result.as_text())
self.assertTrue(plugin_result.as_xml())
# Test the --ca_path option
plugin_result = plugin.process_task(server_info, 'certinfo_basic',
{'ca_file': os.path.join(os.path.dirname(__file__), 'utils',
'wildcard-self-signed.pem')})
self.assertEquals(len(plugin_result.path_validation_result_list), 6)
for path_validation_result in plugin_result.path_validation_result_list:
if path_validation_result.trust_store.name == 'Custom --ca_file':
self.assertFalse(path_validation_result.is_certificate_trusted)
else:
self.assertTrue(path_validation_result.is_certificate_trusted)
示例4: test_valid_chain_with_ev_cert
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_valid_chain_with_ev_cert(self):
server_info = ServerConnectivityInfo(hostname='www.comodo.com')
server_info.test_connectivity_to_server()
plugin = CertificateInfoPlugin()
plugin_result = plugin.process_task(server_info, CertificateInfoScanCommand())
self.assertTrue(plugin_result.is_leaf_certificate_ev)
self.assertEqual(len(plugin_result.certificate_chain), 3)
self.assertEqual(len(plugin_result.verified_certificate_chain), 3)
self.assertFalse(plugin_result.has_anchor_in_certificate_chain)
self.assertEqual(len(plugin_result.path_validation_result_list), 5)
for path_validation_result in plugin_result.path_validation_result_list:
self.assertTrue(path_validation_result.is_certificate_trusted)
self.assertEqual(len(plugin_result.path_validation_error_list), 0)
self.assertEqual(plugin_result.certificate_matches_hostname, True)
self.assertTrue(plugin_result.is_certificate_chain_order_valid)
self.assertTrue(plugin_result.as_text())
self.assertTrue(plugin_result.as_xml())
# Ensure the results are pickable so the ConcurrentScanner can receive them via a Queue
self.assertTrue(pickle.dumps(plugin_result))
示例5: test_invalid_chain
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_invalid_chain(self):
server_info = ServerConnectivityInfo(hostname='self-signed.badssl.com')
server_info.test_connectivity_to_server()
plugin = CertificateInfoPlugin()
plugin_result = plugin.process_task(server_info, CertificateInfoScanCommand())
self.assertIsNone(plugin_result.ocsp_response)
self.assertEqual(len(plugin_result.certificate_chain), 1)
self.assertEqual(len(plugin_result.path_validation_result_list), 5)
for path_validation_result in plugin_result.path_validation_result_list:
self.assertFalse(path_validation_result.is_certificate_trusted)
self.assertEqual(plugin_result.certificate_included_scts_count, 0)
self.assertEqual(len(plugin_result.path_validation_error_list), 0)
self.assertEqual(plugin_result.certificate_matches_hostname, True)
self.assertTrue(plugin_result.is_certificate_chain_order_valid)
self.assertIsNone(plugin_result.has_anchor_in_certificate_chain)
self.assertIsNone(plugin_result.has_sha1_in_certificate_chain)
self.assertFalse(plugin_result.verified_certificate_chain)
self.assertTrue(plugin_result.as_text())
self.assertTrue(plugin_result.as_xml())
# Ensure the results are pickable so the ConcurrentScanner can receive them via a Queue
self.assertTrue(pickle.dumps(plugin_result))
示例6: test_sha256_chain
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_sha256_chain(self):
server_info = ServerConnectivityInfo(hostname='sha256.badssl.com')
server_info.test_connectivity_to_server()
plugin = CertificateInfoPlugin()
plugin_result = plugin.process_task(server_info, 'certinfo_basic')
self.assertIn('OK - No SHA1-signed certificate in the chain', '\n'.join(plugin_result.as_text()))
self.assertTrue(plugin_result.as_xml())
示例7: test_1000_sans_chain
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_1000_sans_chain(self):
# Ensure SSLyze can process a leaf cert with 1000 SANs
server_info = ServerConnectivityInfo(hostname='1000-sans.badssl.com')
server_info.test_connectivity_to_server()
plugin = CertificateInfoPlugin()
plugin_result = plugin.process_task(server_info, 'certinfo_basic')
san_list = plugin_result.certificate_chain[0].as_dict['extensions']['X509v3 Subject Alternative Name']['DNS']
self.assertEquals(len(san_list), 1000)
示例8: test_sha1_chain
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_sha1_chain(self):
server_info = ServerConnectivityInfo(hostname='sha1-intermediate.badssl.com')
server_info.test_connectivity_to_server()
plugin = CertificateInfoPlugin()
plugin_result = plugin.process_task(server_info, CertificateInfoScanCommand())
self.assertTrue(plugin_result.has_sha1_in_certificate_chain)
self.assertTrue(plugin_result.as_text())
self.assertTrue(plugin_result.as_xml())
示例9: test_sha1_chain
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_sha1_chain(self):
server_info = ServerConnectivityInfo(hostname='sha1-2017.badssl.com')
server_info.test_connectivity_to_server()
plugin = CertificateInfoPlugin()
plugin_result = plugin.process_task(server_info, 'certinfo_basic')
# TODO: Expose has_sha1 as an attribute
self.assertIn('INSECURE - SHA1-signed certificate in the chain', '\n'.join(plugin_result.as_text()))
self.assertTrue(plugin_result.as_xml())
示例10: test_unicode_certificate
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_unicode_certificate(self):
server_info = ServerConnectivityInfo(hostname=u'www.főgáz.hu')
server_info.test_connectivity_to_server()
plugin = CertificateInfoPlugin()
plugin_result = plugin.process_task(server_info, 'certinfo_basic')
self.assertTrue(plugin_result.certificate_chain)
self.assertTrue(plugin_result.as_text())
self.assertTrue(plugin_result.as_xml())
示例11: test_optional_client_authentication
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_optional_client_authentication(self):
for hostname in ['auth.startssl.com', 'xnet-eu.intellij.net']:
server_info = ServerConnectivityInfo(hostname=hostname)
server_info.test_connectivity_to_server()
self.assertEquals(server_info.client_auth_requirement, ClientAuthenticationServerConfigurationEnum.OPTIONAL)
plugin = CertificateInfoPlugin()
plugin_result = plugin.process_task(server_info, 'certinfo_basic')
self.assertTrue(plugin_result.as_text())
self.assertTrue(plugin_result.as_xml())
示例12: test_smtp_custom_port
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_smtp_custom_port(self):
server_info = ServerConnectivityInfo(hostname='smtp.gmail.com', port=587,
tls_wrapped_protocol=TlsWrappedProtocolEnum.STARTTLS_SMTP)
server_info.test_connectivity_to_server()
plugin = CertificateInfoPlugin()
plugin_result = plugin.process_task(server_info, 'certinfo_basic')
self.assertEquals(len(plugin_result.certificate_chain), 3)
self.assertTrue(plugin_result.as_text())
self.assertTrue(plugin_result.as_xml())
示例13: test_xmpp_to
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_xmpp_to(self):
server_info = ServerConnectivityInfo(hostname='talk.google.com',
tls_wrapped_protocol=TlsWrappedProtocolEnum.STARTTLS_XMPP,
xmpp_to_hostname='gmail.com')
server_info.test_connectivity_to_server()
plugin = CertificateInfoPlugin()
plugin_result = plugin.process_task(server_info, 'certinfo_basic')
self.assertEquals(len(plugin_result.certificate_chain), 3)
self.assertTrue(plugin_result.as_text())
self.assertTrue(plugin_result.as_xml())
示例14: test_starttls
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_starttls(self):
for hostname, protocol in [('imap.comcast.net', TlsWrappedProtocolEnum.STARTTLS_IMAP),
('pop.comcast.net', TlsWrappedProtocolEnum.STARTTLS_POP3),
('ldap.virginia.edu', TlsWrappedProtocolEnum.STARTTLS_LDAP),
('jabber.org', TlsWrappedProtocolEnum.STARTTLS_XMPP_SERVER)]:
server_info = ServerConnectivityInfo(hostname=hostname, tls_wrapped_protocol=protocol)
server_info.test_connectivity_to_server()
plugin = CertificateInfoPlugin()
plugin_result = plugin.process_task(server_info, 'certinfo_basic')
self.assertTrue(plugin_result.as_text())
self.assertTrue(plugin_result.as_xml())
示例15: test_ecdsa_certificate
# 需要导入模块: from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin [as 别名]
# 或者: from sslyze.plugins.certificate_info_plugin.CertificateInfoPlugin import process_task [as 别名]
def test_ecdsa_certificate(self):
server_info = ServerConnectivityInfo(hostname='www.cloudflare.com')
server_info.test_connectivity_to_server()
plugin = CertificateInfoPlugin()
plugin_result = plugin.process_task(server_info, CertificateInfoScanCommand())
self.assertGreaterEqual(len(plugin_result.certificate_chain), 1)
self.assertTrue(plugin_result.as_text())
self.assertTrue(plugin_result.as_xml())
# Ensure the results are pickable so the ConcurrentScanner can receive them via a Queue
self.assertTrue(pickle.dumps(plugin_result))