本文整理汇总了Python中OpenSSL.SSL.Connection.get_cipher_name方法的典型用法代码示例。如果您正苦于以下问题:Python Connection.get_cipher_name方法的具体用法?Python Connection.get_cipher_name怎么用?Python Connection.get_cipher_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSSL.SSL.Connection
的用法示例。
在下文中一共展示了Connection.get_cipher_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: exit
# 需要导入模块: from OpenSSL.SSL import Connection [as 别名]
# 或者: from OpenSSL.SSL.Connection import get_cipher_name [as 别名]
exit(1)
pass
#--- Get the remote host name
rhost = soc.getpeername()
log(("\nRemote Host name :" + host), sink)
log(("\nRemote Host IPv4 :" + rhost[0]), sink)
log(("\nRemote Host Port :" + str(rhost[1])), sink)
#--- Get and Analyse Server Certificate
cert = soc_ssl.get_peer_certificate()
cipher = soc_ssl.get_cipher_name()
log(("\nCipher Suite used : " + cipher), sink)
#--- Get Subject Info
subject_comps = cert.get_subject().get_components()
subject_name = cert.get_subject().commonName
if (not subject_name):
subject_name = get_x509_val(subject_comps, "O")
log("\nSubject Name = " + subject_name, sink)
subject_email = cert.get_subject().emailAddress