cURL / Mailing Lists / curl-library / Single Mail


Unable to use libcurl to a site requiring client authentication

From: Jayaprakasam, Kannan <>
Date: Wed, 25 May 2011 17:36:19 +0530

I'm using the below snipped for setting the certificate and key for
client authentication.








The certificate doesn't have a password, I don't know why on earth the
option SSLCERTPASSWD exists, I just provided a dummy value.

When I run the program on Linux I get an error code of 58 and an error

unable to set private key file: 'privateKey.pem' type PEM


On Windows however I get

unable to use client certificate (no key found or wrong pass phrase?)


It seems to suggest the certificate and the key don't match but I don't
know how. I have extracted both the cert and the key from a p12 file
using openssl commands. I'm attaching the p12 file, certificate and the
key, in case you want to verify the contents.

The command I used to extract the key is

openssl.exe pkcs12 -in client.p12 -nocerts -out privateKey.pem

and the command used to extract the cert is

openssl.exe pkcs12 -in client.p12 -nokeys -out clientCert.pem


The p12 file has been successfully used in a browser to access the
client authentication url.

Please help before I shoot myself.




List admin:

Received on 2011-05-25