mvantellingen / python-zeep

A Python SOAP client
http://docs.python-zeep.org
Other
1.87k stars 578 forks source link

Certificate verify failed: self signed certificate #1378

Closed stodge closed 1 year ago

stodge commented 1 year ago

I'm getting an exception due to a self signed certificate. I've tried all the suggestions in the various tickets here but nothing works:

from zeep import Client
from requests import Session

session = Session()
session.verify = False

client = Client(WSDL_URL)
client.transport.session.verify = False
result = client.service.callService()

The exception is:

(Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:992)')))

Am I doing anything wrong or is this the correct way? Thanks

stodge commented 1 year ago

Of course, minutes after I posted this, and after trying a different search engine, I found something that works! Doh!

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

WSDL_URL = ""

session = Session()
session.verify = False
transport = Transport(session=session)

client = Client(WSDL_URL, transport=transport)
client.transport.session.verify = False
result = client.service.calLService()
stodge commented 1 year ago

Closing.