I'm trying to make a RESTfull call in Python (2.7) to a tomcat server and it must be done using SSL with client certificate.
The following line is how the call to tomcat is done:
result = requests.get(url, headers=headers, verify=settings.SLA_CA_SERVER_CERTIFICATE, cert=(settings.SLA_CLIENT_CERTIFICATE_PUBLIC, settings.SLA_CLIENT_CERTIFICATE_PRIVATE), **kwargs)
I got the following error:
[Errno 336265225] _ssl.c:355: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib ()
I've tried using in the cert variable .pem files and .key and .crt files and had no luck. The private key hasn't a password. Any clue why I'm having this error?
Thank you very much
I was creating the public certificate and private key from .p12 file using openssl in windows. I created them using and openssl from linux (ubuntu) and it worked.
Just informative, the commands used to create the keys where
openssl pkcs12 -in path.p12 -out newfile.crt.pem -clcerts -nokeys
openssl pkcs12 -in path.p12 -out newfile.key.pem -nocerts -nodes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With