我想将完整的证书链转储到PEM文件中。目前,我正在使用pyOpenSSL模块进行尝试,因为ssl模块没有提供获取证书链的方法(只有服务器证书下载可用)
import OpenSSL
def get_cert_chain(address, port=443):
context = Context(SSLv23_METHOD)
client = socket()
client.connect((address, port))
clientSSL = Connection(context, client)
clientSSL.set_connect_state()
clientSSL.do_handshake()
return clientSSL.get_peer_cert_chain()
#The below certificate_chain variable contains the stack of X509 certificates
certificate_chain = get_cert_chain('www.google.com')
目的:我想导入完整的目标IP链,并通过.pem文件运行keytool导入,以添加到Wildfly truststore中。但是,X509类中没有方法执行像将链转储到.pem文件或类似的操作
为相同的-(调试点)添加了下面的屏幕截图
目前没有回答
相关问题 更多 >
编程相关推荐