我可以通过SSL套接字上的getpeercert()方法获取Python 3.3中SSL连接的标准证书信息。但是,似乎并没有像OpenSSL的“s_client”工具那样提供链。使用Python获取证书链3.3 SSL模块
有什么办法可以得到这个,这样我就可以看到我的IA证书配置是否正确?
的s_client.First命令行:
openssl s_client -connect google.com:443
的s_client.First结果(只是第几行):
$ openssl s_client -connect google.com:443
CONNECTED(00000003)
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=*.google.com
i:/C=US/O=Google Inc/CN=Google Internet Authority G2
1 s:/C=US/O=Google Inc/CN=Google Internet Authority G2
i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA
2 s:/C=US/O=GeoTrust Inc./C