3

I want to access a web service over HTTPS.

I have been given a client certificate (p12 file) in order to access it. Previously we were using basic authentication.

Using python I am unsure how to access it.

I want to use httplib2

h = Http()
#h.add_credentials("testuser", "testpass")
#h.add_certificate(keyfile, certfile, '')
resp, content = h.request("https://example.com/webservice", "POST", xml_data)
print content

Now, I am quite new to SSL, Can I just call add_cert or somethign similar and give it the p12 file. Do I need to convert it to a PEM file?

1 Answer 1

2

The answer to my question was IN my question

h.add_certificate(keyfile, certfile, '')

I had a pkcs12 file, I just needed to extract out the key and cert from the p12 file.

openssl pkcs12 -in file.p12 -out key.pem -nodes -nocerts
openssl pkcs12 -in file.p12 -out cert.pem -nodes -nokeys
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.