Curl_exec Error 58
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might php curl exec have Meta Discuss the workings and policies of this site About
Php Exec Curl Post
Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting
Curl Multi Exec
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 of 4.7
Python Exec Curl
million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PHP cURL error 58 up vote 1 down vote favorite Need some help understanding the ubiquitous cURL 58 error, which is due to, in this case, including a PEM file with the cURL request. Error 58: unable to curl exec failed timeout was reached set private key file My code can successfully open the .pem file (see fopen() call) but cURL complains that it cannot set the private key file. Trying to better understand if this something on the client end (me) or something being returned from the host. Pretty sure it's on my end but not sure what. Thanks $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->apiURL); $fh = fopen($this->certPath,'a+'); if($fh){ echo "File opened!"; fclose($fh); } else { echo "File not opened"; } curl_setopt($ch, CURLOPT_SSLCERT, $this->certPath); curl_setopt($ch, CURLOPT_POSTFIELDS, trim($SOAPrequest)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); if (curl_error($ch)) { printf("Error %s: %s", curl_errno($ch), curl_error($ch)); } curl_close ($ch); return $result; } The key: -----BEGIN CERTIFICATE----- MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL [...] -----END CERTIFICATE----- php curl share|improve this question edited Apr 17 '13 at 12:39 asked Apr 16 '13 at 16:33 Slinky 2,55464389 You're using a client cert without a private key. Why? I think you've missed to read up on A) what you want and/or B) what a client cert i
in my Payments Standard account? 42 1 day ago FAQ2066 curl: (58) unable to set private key file: type pem Why am I not receiving funds for completed orders? 35 curl unable to load client cert -8018 14 days ago FAQ2065 How do I apply for Website Payments Pro? 38 14 unable to set private key file php days ago FAQ2064 How do I make the phone field mandatory with Express Checkout? 36 35 days ago FAQ2063 How do I successfully http://stackoverflow.com/questions/16042361/php-curl-error-58 complete an Express Checkout API call? 41 35 days ago FAQ2062 Where can I find PayPal Reporting information? 160 41 days ago FAQ2061 How do I use IPN in my third-party shopping cart for Express Checkout? 165 42 days ago FAQ2060 Are Adaptive Payments disputes applicable for EDM https://www.paypal-knowledge.com/infocenter/index?page=content&id=FAQ1091&actp=LIST merchants and/or partners? 198 49 days ago FAQ2059 Can you fund Adaptive Payments with PayPal Credit? 188 49 days ago FAQ2058 Why are my PayPal PLUS payments being declined? 233 49 days ago FAQ2057 What is Seller Protection? 190 49 days ago FAQ2056 How do I return customers to my merchant site after completing checkout? 238 58 days ago FAQ2055 Why does my code change when I paste it into my website and apply changes? 265 58 days ago FAQ2053 Why do customers get the error “PayPal cannot process your payment. Please contact the merchant to solve this issue”? 293 58 days ago FAQ2054 Why do I get the error “You must specify a valid parameters A3, P3, and T3 for a subscription.” 261 58 days ago Pages: 50 - [ 1 2 3 4 5 … 50 | Next ]
and Objects Namespaces Errors Exceptions Generators References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Context options and parameters Supported Protocols and http://php.net/manual/en/function.curl-errno.php Wrappers Security Introduction General considerations Installed as CGI binary Installed https://codedump.io/share/5YZt6nTQTzmI/1/curl-with-ssl-certificates-fails-error-58-unable-to-set-private-key-file as an Apache module Session Security Filesystem Security Database Security Error Reporting Using Register Globals User Submitted Data Magic Quotes Hiding PHP Keeping Current Features HTTP authentication with PHP Cookies Sessions Dealing with XForms Handling file uploads Using remote files Connection handling unable to Persistent Database Connections Safe Mode Command line usage Garbage Collection DTrace Dynamic Tracing Function Reference Affecting PHP's Behaviour Audio Formats Manipulation Authentication Services Command Line Specific Extensions Compression and Archive Extensions Credit Card Processing Cryptography Extensions Database Extensions Date and Time Related Extensions File System Related Extensions Human Language and Character Encoding unable to set Support Image Processing and Generation Mail Related Extensions Mathematical Extensions Non-Text MIME Output Process Control Extensions Other Basic Extensions Other Services Search Engine Extensions Server Specific Extensions Session Extensions Text Processing Variable and Type Related Extensions Web Services Windows Only Extensions XML Manipulation Keyboard Shortcuts? This help j Next menu item k Previous menu item g p Previous man page g n Next man page G Scroll to bottom g g Scroll to top g h Goto homepage g s Goto search(current page) / Focus search box curl_error » « curl_copy_handle PHP Manual Function Reference Other Services cURL cURL Functions Change language: English Brazilian Portuguese Chinese (Simplified) French German Japanese Korean Romanian Russian Spanish Turkish Other Edit Report a Bug curl_errno (PHP 4 >= 4.0.3, PHP 5, PHP 7)curl_errno — Return the last error number Description int curl_errno ( resource $ch ) Returns the error number for the last cURL operation. Parameters ch A cUR
Gherkin Git Go Groovy Haml Handlebars Haskell HTML HTTP Ini iOS Jade Java Javascript jQuery JSON Julia Keyman LaTeX Linux Less LOLCODE Makefile Markdown MATLAB MySQL NASM Node.js NSIS Objective-C Pascal Perl PHP PHP Extras PowerShell Python R React JSX reST (reStructuredText) Rip Ruby Rust SAS Sass (Sass) Sass (Scss) Scala Scheme Smalltalk Smarty SQL Stylus Swift Twig TypeScript Vb.net VHDL Wiki markup YAML Other Search Ben - 3 months ago 74x PHP Question cURL with SSL certificates fails: error 58 unable to set private key file I'm trying to connect to a remote host using cURL. The connection requires the use of a certificate and a private key which is password protected. So far I'm unsuccessful with this code below: $wsdl = 'https://domain.com/?wsdl';
$certFile = getcwd() . '/auth/cert.pem';
$keyFile = getcwd() . '/auth/key.pem';
$password = 'pwd';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $wsdl);
curl_setopt($ch, CURLOPT_SSLCERT, $certFile);
curl_setopt($ch, CURLOPT_SSLKEYPASSWD, $password);
curl_setopt($ch, CURLOPT_SSLKEY, $keyFile);
#curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
#curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
#curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$output = curl_exec($ch);
var_dump(curl_errno($ch));
var_dump(curl_error($ch));
The result I keep getting is error 58: unable to set private key file: '/home/.../domains/.../public_html/auth/key.pem' type PEM. Things I've tried so far: Check if the key-file is readable as suggested here: Unable to use libcurl to access a site requiring client authentication. Trying to pass the file through openssl_private_key() gives me a resource, and not a boolean. So this seems good. Switch the order of the content in the key.pem file as suggested here: Unable to use libcurl to access a site requiring client authentication. No luck so far. Played around with some other options like SLL_VERIFY_PEER, SSL_VERIFY_HOST, SSL_CERTTYPE and other options which seemed trivial regarding the official PHP-docs. No luck so far. I'm pretty sure the problem lies somehwere in my configuration, but I'm not sure where to look. Ben Answer Email {} Share I've fixed this problem. I think, due to the number of questions regard