Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

Soap call using pfx or p12 authentication in Zeep or suds library Python

I want to use SOAP call service using .p12 certificate file. I tried below code. But it throws path error.

Is there any solution for this, in suds python3?

*TypeError: stat: path should be string, bytes, os.PathLike or integer, not X509*

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

pkcs12 = crypto.load_pkcs12(open(CertPath, 'rb').read(), Password)
session = Session()
session.cert = (pkcs12.get_certificate(),pkcs12.get_privatekey())
transport = Transport(session=session)
client = Client(
    'http://my.own.sslhost.local/service?WSDL',
    transport=transport) 
question from:https://stackoverflow.com/questions/65856758/soap-call-using-pfx-or-p12-authentication-in-zeep-or-suds-library-python

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...