mvantellingen / python-zeep

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

How to pass certificate in base64.cer file? #1238

Closed Headmaster11 closed 3 years ago

Headmaster11 commented 3 years ago

Version == 3.4.0

I have base64.cer file with certificate, something like this

-----BEGIN CERTIFICATE-----
MIIGGDCCBQCgAwIBAgITcwAHCoPQ7YzgDXiRHQACAAcKgzANBgkqhkiG9w0BAQsF
oWt63wOSxGxa3ASu1UFGCd9o+PxnaUA12EGU9A==
-----END CERTIFICATE-----

And I need to add this certificate to request. How to do this? I have tried

    session.verify = True
    session.cert = settings.CERT_PATH
        client = Client(transport=Transport(session=session), wsdl=host)
        response = client.service.uploadMedia(uploadMediaData={'fileName': image.name, 'fileData': image.read()})

but got such error HTTPSConnectionPool(host='some.host', port=443): Max retries exceeded with url: /webservices/MediaPool/?wsdl (Caused by SSLError(SSLError(9, '[SSL] PEM lib (_ssl.c:4050)'))

What the problem might be?