我正在构建一个脚本来访问HTTPS/TLS TCP站点,该站点需要X.509证书(作为.pfx文件拥有)。

我正在使用SOAPpy 0.12.5和Python 2.7,并且从以下代码开始,

import SOAPpy
url = "192.168.0.1:5001"
server = SOAPpy.SOAPProxy(url)

# I think I need to pass the cert to server here...

server.callSoapRPC(xxxx)

如果我尝试运行此命令,它将失败,并显示以下消息
socket.error: [Errno 10061] No connection could be made because the target machine actively refused it

任何建议如何将.pfx证书与SOAPproxy绑定(bind)在一起?

谢谢

最佳答案

我设法做到这一点:

import SOAPpy
SOAPpy.Config.SSL.cert_file = 'cert_file'
SOAPpy.Config.SSL.key_file = 'key_file'

server = SOAPpy.SOAPProxy(url, config=config)

10-04 23:23