如何使用SOAPpy / Python将SSL证书传递给SOAP服务器

时间:2011-10-28 09:32:48

标签: python ssl x509 soappy

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

我正在使用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?

由于

1 个答案:

答案 0 :(得分:1)

我设法这样做了:

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

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