I am trying to send POST messages to a web server. In order to do that, I am using python requests and trying to pass the requests.post method a certificate as an argument.
It looks something like that:
if method_type == METHOD_TYPE_GET:
resp = requests.get(base_url, data=request_data, verify=True, headers=headers, cert=certificate)
if method_type == METHOD_TYPE_POST:
resp = requests.post(base_url, data=request_data, verify=True, headers=headers, cert=certificate)
return resp
When 'certificate' is the path to a pem file, which contains the server's certificate. The file is of format:
-----BEGIN CERTIFICATE-----
-base64data-
-----END CERTIFICATE-----
When I try to execute the post method, I get an Exception of: [SSL] PEM lib (_ssl.c:3309)
Any idea what the problem is?
please check your openssl - configuration file setting for the following parameter extendedKeyUsage = clientAuth
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