我正在构建一个脚本来访问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证书绑定到soap吗?
谢谢
我是这样做的:
import SOAPpy
SOAPpy.Config.SSL.cert_file = 'cert_file'
SOAPpy.Config.SSL.key_file = 'key_file'
server = SOAPpy.SOAPProxy(url, config=config)