Python Requests – SSL error for client side cert

I had this same problem. The verify parameter refers to the server’s certificate. You want the cert parameter to specify your client certificate.

import requests
cert_file_path = "cert.pem"
key_file_path = "key.pem"

url = "https://example.com/resource"
params = {"param_1": "value_1", "param_2": "value_2"}
cert = (cert_file_path, key_file_path)
r = requests.get(url, params=params, cert=cert)

Leave a Comment