0

I would like to use a client certificate for the authentification at my REST-Service. After testing the configuration with my generated certificates in Firefox I would say, that my configuration is right, since the authentification at my service works as desired. Now, I have to implement this certificate into my python-script. I'm using python-requests:

rsp = requests.put(url='{0}recorditems/{1}'.format(daemonConfig['service']['url'], recorditemOID)
, data=body, headers=headers
, cert=daemonConfig['daemon']['certPath'], verify=False)

But when I send a requests via this method and start debugging in Visual Studio, the object Request.ClientCertificate.Certificate has the length 0; no certificate is included. The certificate exists definitely at the location specified in my configuration.

1 Answer 1

1

If you have the path to the certificate that should be passed to verify not cert. cert accepts a tuple. Also by setting verify=False you're telling requests to ignore the cert parameter altogether.

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.