在线检查证书过期时间

2017-12-26  本文已影响0人  新高_Butland

如何检查线上域名的过期时间,sslyze这个包不错,可以试试

from sslyze import *

from sslyze.server_connectivity import *

from sslyze.plugins.certificate_info_plugin import *

from sslyze.synchronous_scanner import *

server_info = ServerConnectivityInfo(hostname=u'www.baidu.com')

server_info.test_connectivity_to_server(network_timeout=1)

synchronous_scanner = SynchronousScanner()

command = CertificateInfoScanCommand()

scan_result = synchronous_scanner.run_scan_command(server_info, command)

cert=scan_result.certificate_chain[0]

print(cert.not_valid_after)

上一篇下一篇

猜你喜欢

热点阅读