cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Verification of SSL Certificates

From: Austin Montoya <amontoya_at_ist.ucf.edu>
Date: Tue, 03 Jun 2008 12:18:35 -0400

Hi, I am fairly new to cURL using the PHP binding. The main problem I
have is that I am trying to use SSL to connect to a remote server, but
every time I try to connect, cURL responds with

"SSL certificate problem, verify that the CA cert is OK. Details:
 error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate
verify failed"

I exported each certificate from Internet Explorer and converted them
from .p7b format to .cer, and then changed the extension to .pem. These
certificates are placed in a directory on the server called
'ca-certificates' one level below the working directory of the php file,
which I specify to cURL by curl_setopt(..., CURLOPT_CAPATH, ...). The
cURL-specific code is as follows:
 
...
  $curl_handle = curl_init();
//Set the curl options for the http request
  curl_setopt($curl_handle, CURLOPT_CAPATH, './ca-certificates');
  curl_setopt($curl_handle, CURLOPT_URL, $url);
 curl_setopt($curl_handle, CURLOPT_POST, TRUE);
 curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, '1');
 curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, TRUE);
$success = curl_exec($curl_handle);
...

The actual output of curl_exec is not important; I can do that on my
own. What I do want to know, though, is whether there is a problem with
the certificates themselves or with cURL correctly locating/reading the
certificates. I have looked at http://curl.haxx.se/docs/sslcerts.html
and tried using option 2 (following it as closely as possible), but that
did not work. Any help would be greatly appreciated!

Regards,

Austin Montoya
Undergraduate Research Assistant
University of Central Florida
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-06-03