在连接中调用getPeerCertificate在扭曲返回中制成无我该怎么办
class Handler(Protocol):
def dataReceived(self, data):
print self.transport.getPeerCertificate().get_subject().commonName
def connectionMade(self):
print self.transport.getPeerCertificate().get_subject().commonName
最佳答案
不要在getPeerCertificate
中呼叫connectionMade
。如您所见,如果在dataReceived
中调用它,它将返回正确的证书。
关于python - 连接中扭曲调用getPeerCertificate的方法返回无,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10976491/