mvantellingen / python-zeep

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

xmlsec.InternalError: (-1, 'failed to sign') #1016

Open kaushikdr opened 4 years ago

kaushikdr commented 4 years ago

I got the private_key.pem and the public_cert.pem from the .pfx file using OpenSSL.

I also have the username and password for the username token. So while creating the client for the wsdl, I use both the username_token and the Signature for wsse but xmlsec fails to sign with the error xmlsec.InternalError: (-1, 'failed to sign')

I am using the below code to create the signature and then call the client

session = Session()
session.verify = "path/to/publiccert.pem"
transport = Transport(session=session)
user_name_token = UsernameToken('username', 'password')
signature = Signature('privatekey.pem', 'publiccert.pem', "password",  
    digest_method=xmlsec.Transform.RSA_SHA1)
client = Client("wsdl_file.xml",
    transport=transport, 
    wsse=[user_name_token, signature])

req_data = {some_data}

The data are replaced

Can someone help me in this???``

bng-dev commented 4 years ago

@kaushikdr have you managed to figure this out?

kaushikdr commented 4 years ago

@bng-dev, no we used a java adapter instead.