PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
It is currently Tue Sep 29, 2020 5:56 am

All times are UTC - 5 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue May 01, 2012 3:41 am 
Forum Newbie

Joined: Tue May 01, 2012 3:39 am
Posts: 1
The following code returns Exit code 58.

From cURL documentation:
problem with the local client certificate.

Syntax: [ Download ] [ Hide ]
    // create a new CURL resource
    $ch = curl_init();
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, $URL);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_VERBOSE, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    curl_setopt($ch, CURLOPT_SSLCERT, getcwd() . $CERT);
    curl_setopt($ch, CURLOPT_SSLCERTPASSWD,"XXXXX");
    curl_setopt($ch, CURLOPT_SSLVERSION, 3);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Content Type: text/xml',
        'User-Agent: XXXXX',
        'User-Name: XXXXX'
    $RESPONSE = curl_exec($ch);  
    // close CURL resource, and free up system resources

Is there something I'm missing?

PostPosted: Tue May 01, 2012 12:07 pm 
Briney Mod
User avatar

Joined: Mon Jan 19, 2004 7:11 pm
Posts: 6446
Location: 53.01N x 112.48W
My guess is cURL is having difficulty verifying the certificate. Try commenting out the two verification steps to see if that works. Note that this is just a test to see where the problem is - you should always verify.

If that doesn't change anything, then it's probably the next 2 lines. Make sure you're specifying the correct path to your .PEM file.

Real programmers don't comment their code. If it was hard to write, it should be hard to understand.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours

Who is online

Users browsing this forum: No registered users and 10 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group