ionik Posted September 23, 2009 Share Posted September 23, 2009 Hello, I am having a small issue with using a digital ID for server - server communication .... when I try to run the code I get the error message unable to use client certificate (no key found or wrong pass phrase?) My code is originally written in Python but I have translated it to PHP and CURL works the same across all languages I have the latest Version of cURL installed ( I manually updated it myself 2 days ago ) and the same error happens if I run it in the shell curl --cert /xxx/digitalID.p12 --key /xxx/digitalId.pem --pass xxx https://xxxxxx.com The PHP Code is as follows $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://xxxxxxx.xxx.com"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_MAXREDIRS, 5); curl_setopt($ch, CURLOPT_SSLCERT, '/home/xxx/xxx/digitalID.p12'); curl_setopt($ch, CURLOPT_SSLKEY, '/home/xxx/xxx/digitalID.pem'); curl_setopt($ch, CURLOPT_SSLCERTPASSWD, 'xxxxxx'); curl_setopt($ch, CURLOPT_SSLKEYPASSWD, 'xxxxxx'); curl_exec($ch); curl_close($ch); and the orginal Python code c = pycurl.Curl() c.setopt(pycurl.URL, FirstDataAPI_URL) c.setopt(pycurl.HTTPHEADER, ["Accept:"]) c.setopt(pycurl.POST, 1) c.setopt(pycurl.POSTFIELDS, urllib.urlencode(FirstDataAPI_PostData)) import StringIO b = StringIO.StringIO() c.setopt(pycurl.WRITEFUNCTION, b.write) c.setopt(pycurl.FOLLOWLOCATION, 1) c.setopt(pycurl.MAXREDIRS, 5) c.setopt(pycurl.SSLCERT, '/home/dgiftcard/disney/ssl/digitalID.p12') c.setopt(pycurl.SSLCERTPASSWD, 'xxx') c.setopt(pycurl.SSLKEY, '/home/dgiftcard/disney/ssl/digitalID.pem') c.setopt(pycurl.SSLKEYPASSWD, 'xxx') c.perform() results = b.getvalue() Link to comment https://forums.phpfreaks.com/topic/175214-solved-curl-ssl-cert-key-file-wrong-pass-phrase-incorrect/ Share on other sites More sharing options...
ionik Posted September 23, 2009 Author Share Posted September 23, 2009 ISSUE RESOLVED Link to comment https://forums.phpfreaks.com/topic/175214-solved-curl-ssl-cert-key-file-wrong-pass-phrase-incorrect/#findComment-923545 Share on other sites More sharing options...
eweig Posted June 29, 2011 Share Posted June 29, 2011 Could you post the solution? Link to comment https://forums.phpfreaks.com/topic/175214-solved-curl-ssl-cert-key-file-wrong-pass-phrase-incorrect/#findComment-1236529 Share on other sites More sharing options...
Alex Posted June 29, 2011 Share Posted June 29, 2011 Please don't bump very old threads. It's unlikely you'll get a reply, especially since the OP hasn't been active for over a year. If you have a similar issue make a new thread. Link to comment https://forums.phpfreaks.com/topic/175214-solved-curl-ssl-cert-key-file-wrong-pass-phrase-incorrect/#findComment-1236553 Share on other sites More sharing options...
Recommended Posts