Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Cannot supply SSL client certificate #244
I am trying to access websites that require a SSL Client Certificate.
I am running on Windows (XP) using the 22.214.171.124 Windows distribution (pycurl-7.19.5.win32-py2.7.msi or pycurl-7.19.5.win32-py3.4.msi) under either python 2.7.6 or 3.4.0
But all the setopt mechanisms for specifying a client certificate are ignored and pycurl always uses the only (or first) client certificate in the Internet Explorer certificate store.
ie: any curl.setopt(curl.SSLCERT…) or curl.setopt(curl.SSLKEY…) is ignored.
I have googled for hours and tried all sort of combinations of these options to no avail.
To illustrate the code I am using, on the same PC I can access a site using curl.exe as:
curl -s --insecure --cacert ../rootAndCA.pem --cert ../ResMonitor.crt.pem:PassWord --key ../ResMonitor.key.pem --location --cookie-jar ./cookies.tmp https://wiki-uat.ib.internal
which presents the correct certificate. But, the following does not:
curl = pycurl.Curl()
curl.setopt(pycurl.FOLLOWLOCATION, 1) ## cf: --location
print("Response code: " + str(curl.getinfo(pycurl.RESPONSE_CODE)))