python-zeep icon indicating copy to clipboard operation
python-zeep copied to clipboard

Added support for specifying a different certificate for verification

Open VictorGerritsen opened this issue 5 years ago • 1 comments

I've had a use case where i need to specify a different certificate for validating responses to requests that were signed with Zeep's BinarySignature (from zeep.wsse.signature import BinarySignature)

Related issue skips verification entirely: #996

Usage example:

wsse_sig = BinarySignature("my_private.key", "my_public.cer", verify_cert_file="their_public.cer")
client = Client(url_to_wsdl, wsse=wsse_sig)

VictorGerritsen avatar Aug 21 '20 08:08 VictorGerritsen

I am sorry, i just stumbled across another PR which addresses the same issue: #1118

However, that PR adds the option to disable verification entirely which i am not sure is a good idea? You can always do:

try:
    client.service.SomeService(**payload)
except SignatureVerificationFailed:
    pass

VictorGerritsen avatar Aug 22 '20 17:08 VictorGerritsen