Thanks for your input. However, I still can't get it work. Do you have success examples? I really don't know how to set the curl options. I am confusing to the options of CURLOPT_CAINFO, CURLOPT_SSLCERT, CURLOPT_SSLKEY, etc. lhb "James Benson" <jb@xxxxxxxxxxxxxxxxx> wrote in message news:3E.26.45475.88878E34@xxxxxxxxxxxxxxx > should it not be:- > G:\\test\ssl\mes1.cer' > > notice how I changed the path to reflect a proper windows drive path! > > > James > > > > > > lhb wrote: >> Hello, >> >> Now I need to use curl to connect to a secure website, >> I have three certificates files, two .cer files and one .pfx file. >> After I import the certificates into IE browser, the visit is OK. >> However, when I use curl_setopt to configure the certificates, it failed. >> Can anybody help me? >> Thanks. >> >> The code is below: >> <? >> $ch = curl_init(); >> >> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); >> curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0); >> curl_setopt($ch, CURLOPT_SSLCERT,'G:\test\ssl\mes1.cer'); >> curl_setopt($ch, CURLOPT_SSLCERT,'G:\test\ssl\mes2.cer'); >> curl_setopt($ch, CURLOPT_SSLKEY, 'G:\test\ssl\xxxx.pfx'); >> curl_setopt($ch, CURLOPT_SSLKEYPASSWD,'password'); >> curl_setopt($ch, CURLOPT_URL, $host.$uri); >> >> curl_setopt($ch, CURLOPT_POST, 1); >> curl_setopt($ch,CURLOPT_HEADER,1); >> curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); >> >> $returned = curl_exec($ch); >> >> echo $returned; >> ?> >> >> lhb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php