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

curl-and-php

ssl handshake and PHP

From: André Brynildsen <andre_at_brynildsen.com>
Date: Mon, 6 Jan 2003 15:43:04 +0100

Hey
 
Can someone help me with SSL handshake and PHP?
 
I should make a client who do a ssl handshake with a web server.
 
Under you se my PHP code to do ha SSL handshake, but it will not work.
What are I doing wrong?
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,https://url/file);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,"request=test");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSLCERT, "cert.pem");
    curl_setopt($ch, CURLOPT_SSLCERTPASSWD, "password");
    curl_setopt($ch, CURLOPT_CAINFO,"thawte_server_ca.arm");
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,2);
    $result = curl_exec ($ch);
    curl_close ($ch);
    print $result;
 
I have testet handshake through openssl s_client, and it worked fine.
 
Please help me.
 
Best regards,
André Brynildsen
 
 

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-01-06