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

curl-and-php

Check server certificate validity

From: nik600 <nik600_at_gmail.com>
Date: Thu, 22 Mar 2007 10:26:05 +0100

I have to check the validity of a certificate on a local server.

This is a piece of my code:

$this->connection=curl_init("https://localhost.testing");
curl_setopt($this->connection, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($this->connection,CURLOPT_CAINFO,"cacert.pem");
curl_setopt($this->connection, CURLOPT_VERBOSE, TRUE);
... ...
... ...

The script check's the certificate, but it doesn't abort the
connection...this is the debug output:

* SSL certificate verify result: unable to get local issuer
certificate (20), continuing anyway.

Why continuing anyway?
How can i force curl to abort the connection if the SSL certificate
verify result isn't certified?

-- 
/*************/
nik600
https://sourceforge.net/projects/ccmanager
https://sourceforge.net/projects/nikstresser
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-03-22