How to transfer SSL certificate to a SOAP server using SOAPpy / Python

I am creating a script to access the HTTPS / TLS TCP site, which requires an X.509 certificate, which I have as a .pfx file.

I use SOAPpy 0.12.5 and Python 2.7 and started with the code as below,

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)

If I try to run this, it will not execute the following message

socket.error: [Errno 10061] No connection could be made because the target machine actively refused it

Any suggestions on how to associate a .pfx certificate with SOAPproxy?

thank

+5
source share
1 answer

I managed to do it as follows:

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

server = SOAPpy.SOAPProxy(url, config=config)
+1
source

All Articles