Curl_exec Error 58 Unable To Use Client Certificate
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might curl: (58) unable to use client certificate (no key found or wrong pass phrase?) have Meta Discuss the workings and policies of this site About
Curl Error 58
Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads unable to set private key file: '' type pem with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million curl client certificate authentication programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Getting (58) unable to use client certificate (no key found or wrong pass phrase?) from curl up vote 3 down vote favorite I'm attempting to make test calls to a third-party API that requires a client cert. I generated
Curl 58 Unable To Load Client Key
a new cert using this command with openssl: req -new -newkey rsa:2048 -nodes -out mycsr.csr -keyout mykey.key I then sent them the csr, and they sent me back mycert.crt. I concatenated the cert and the key together: cat mycert.crt mykey.key > mycertandkey.pem Finally, I added mycert.crt to the ca-certificates folder and ca-certificates.conf and ran "update-ca-certificates --fresh". Now, I'm trying to make curl call from bash using the following command: curl -X GET --cert mycertandkey.pem -H 'Accept-Encoding: gzip,deflate' -H 'Content-Type: application/json' https://api.URL.com I've also tried: curl -X GET --cert mycertandkey.pem --cacert mycert.crt -H 'Accept-Encoding: gzip,deflate' -H 'Content-Type: application/json' https://api.URL.com and: curl -X GET --cert mycertandkey.pem --cacert mycert.crt --key mykey.key -H 'Accept-Encoding: gzip,deflate' -H 'Content-Type: application/json' https://api.URL.com And every other combination I can think of. I always get the error "curl: (58) unable to use client certificate (no key found or wrong pass phrase?)". The key doesn't have a passphrase. All of the cert/key files have 777 permissions. I haven't worked much with certs in
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of curl p12 this site About Us Learn more about Stack Overflow the company Business curlopt_sslcert Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask
Curl Unable To Load Client Cert -8018
Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign http://stackoverflow.com/questions/29799478/getting-58-unable-to-use-client-certificate-no-key-found-or-wrong-pass-phrase up Curl failed with error #58: unable to use client certificate (no key found or wrong pass phrase?) up vote 0 down vote favorite 1 I get this error : Fatal error: Curl failed with error #58: unable to use client certificate (no key found or wrong pass phrase?) I have a script that extracts the certificate information from a .p12 file. I http://stackoverflow.com/questions/26976806/curl-failed-with-error-58-unable-to-use-client-certificate-no-key-found-or-wr thought this was the problem to start, however I used this to paste the contents of my generated .pem file : https://www.sslshopper.com/certificate-decoder.html and it decodes/sees it all fine. So I assume the .pem is ok. $ch = curl_init(); curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSLCERT, 'cert.pem'); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // converting $response = curl_exec($ch); // converting $response1 = str_replace("
here for a quick overview of the site Help Center Detailed answers to any questions you http://stackoverflow.com/questions/27708553/php-openssl-get-publickey-and-curl-unable-to-use-client-certificate-no-key might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community unable to of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up php openssl_get_publickey() and curl - unable to use client certificate (no key found or wrong pass phrase?) up vote 1 down vote favorite I got following code.. And it returns "unable to use client certificate (no key found or wrong pass phrase?)". If i comment line "$pubkey = openssl_get_publickey($kkey);", then curl works fine. Is there any chance, that "something" stays in memory and curl uses it? php curl openssl share|improve this question asked Dec 30 '14 at 15:59 user3564666 163 Maybe the file is getting opened and thus inaccessible to your other code? –nrathaus Jan 1 '15 at 8:51 Openssl is very sensitive on file permission of keys, and you placing them under/var/www looks like a recepie fo