Http Error Curl 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 have Meta Discuss the workings and policies no key found or wrong pass phrase of this site About Us Learn more about Stack Overflow the company curl pkcs12 client certificate Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges unable to set private key file: '' type pem Ask 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:
Curl Client Certificate Authentication
Sign up cURL unable to use client certificate (no key found or wrong pass phrase?) up vote 2 down vote favorite I have read and tried thousands of solutions in different posts and none of them seems to work with me. This three are example of that. cURL is unable to use client certificate , in local server php openssl_get_publickey() and curl curl 58 unable to load client key - unable to use client certificate (no key found or wrong pass phrase?) Getting (58) unable to use client certificate (no key found or wrong pass phrase?) from curl I received a .p12 certificate which I converted to .pem file in https://www.sslshopper.com/ssl-converter.html The password is correct otherwise it wouldn't convert it. $xml = 'my xml here'; $url = 'https://qly.mbway.pt/Merchant/requestFinancialOperationWS'; $headers = array( 'Content-Type: text/xml; charset="utf-8"', 'Content-Length: ' . strlen($xml), 'Accept: text/xml', 'Cache-Control: no-cache', 'Pragma: no-cache' ); $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_SSLCERT, base_url() . 'public/cert.pem'); curl_setopt($ch, CURLOPT_SSLCERTPASSWD, 'my password here'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); $data = curl_exec($ch); if(!$data) print_r('ERROR: ' . curl_error($ch)); else print_r('SUCCESS: ' . curl_error($ch)); I have tried with SoapUI application and works fine but with cURL I'm receiving the error: unable to use client certificate (no key found or wrong pass phrase?) I have tried without success: Disable CURLOPT_SSL_VERIFYPEER and/or CURLOPT_SSL_VERIFYHOST Add CURLOPT_SSLKEYTYPE and/or CURLOPT_SSLKEY fields EDIT 1: I have been trying around with SOAPClient besides cURL and it seems that the er
here for a quick overview of the site Help Center Detailed answers to any curl unable to load client cert -8018 questions you might have Meta Discuss the workings and policies
Curl Cacert
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 http://stackoverflow.com/questions/33740014/curl-unable-to-use-client-certificate-no-key-found-or-wrong-pass-phrase Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PHP CURL error: unable to use client certificate (no key found or wrong pass phrase?) up vote 1 down vote favorite I am doing this: $ch = curl_init(); curl_setopt($ch, http://stackoverflow.com/questions/33498093/php-curl-error-unable-to-use-client-certificate-no-key-found-or-wrong-pass-phr CURLOPT_VERBOSE, '1'); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, '2'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, '1'); curl_setopt($ch, CURLOPT_CAINFO, getcwd().'/public.pem'); curl_setopt($ch, CURLOPT_SSLCERT, getcwd().'/private.key'); curl_setopt($ch, CURLOPT_SSLCERTPASSWD, '1234'); curl_setopt($ch, CURLOPT_SSLKEYPASSWD, '1234'); curl_setopt($ch, CURLOPT_URL, "http://api-xxxxxx.duosecurity.com/auth/v2/preauth"); $dataa = curl_exec($ch); I am getting this error: unable to use client certificate (no key found or wrong pass phrase?) What am I missing? If the code is ok then could you please guide me on how to generate a pair of certificates for this purpose using either openssl OR ssh-keygen? php ssl curl openssl ssh-keygen share|improve this question edited Nov 4 '15 at 11:25 asked Nov 3 '15 at 11:34 Bengali 8911 curl_setopt($ch, CURLOPT_SSLCERT, getcwd().'/public.pem'); curl_setopt($ch, CURLOPT_SSLKEY, getcwd().'/private.key'); –ojovirtual Nov 3 '15 at 11:38 @ojovirtual I tried that before and it gives me this error: error setting certificate verify locations: CAfile: /var/www/duo/api/src/duo.pem CApath: /etc/ssl/certs –Bengali Nov 3 '15 at 11:42 curl_setopt($link, CURLOPT_SSL_VERIFYPEER, FALSE); –ojovirtual Nov 3 '15 at 11:46 @ojovirtual that isn
This message: [ Message body ] [ More options ] Related messages: [ Next message ] [ Previous message ] From: sourav roy
messages: [ Next message ] [ Previous message ] [ In reply to ] From: jayjwa