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

curl-and-php

Re: Check server certificate validity

From: Tijnema ! <tijnema_at_gmail.com>
Date: Thu, 22 Mar 2007 10:46:35 +0100

On 3/22/07, nik600 <nik600_at_gmail.com> wrote:
> 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?

What does your curl_setopt return? i guess it returns false and you
should then cancel everything yourself.

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