0

I'm designing a SOAP client using python and SOAP server I'm connecting to only allows TLSv1.2. I looked up in zeep documentation but couldn't find any setting where I can force it to use only 'TLSv1.2'. If zeep doesn't have this feature, are there any other SOAP python libraries with this feature ?

dhruvvyas90
  • 1,135
  • 1
  • 15
  • 31

1 Answers1

1

For default, zeep uses a TLS 1.2. But if you need to verify the TLS connection (in case you have a self-signed certificate for your host), the best way is to create a requests.Session instance and add the information to that Session, so it keeps persistent:

from requests import Session
from zeep import Client
from zeep.transports import Transport

session = Session()
session.verify = 'path/to/my/certificate.pem'
transport = Transport(session=session)
client = Client(
    'http://my.own.sslhost.local/service?WSDL',
    transport=transport)

Alternatively, instead of using session.verify you can use session.cert if you just want to use an TLS client certificate.

More information in: https://python-zeep.readthedocs.io/en/master/transport.html

Lucas Torres
  • 222
  • 1
  • 2
  • 12