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

curl-and-php

Re: curl: (58) unable to set certificate file (wrong password?)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 28 Oct 2005 00:12:23 +0200 (CEST)

On Thu, 27 Oct 2005, Xin wrote:

> 58 - unable to set certificate file (wrong password?)
>
> I gave the multiple settings below for testing. None of them worked.

certificate here means client certificate.

> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
> curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
>
> #curl_setopt($ch, CURLOPT_CAINFO, 'c:\curl-7.15.0\lib\ca-bundle.crt');
> #curl_setopt($ch, CURLOPT_CAINFO, 'c:\certificate.pem');
> #curl_setopt($ch, CURLOPT_CAINFO,'c:\certnew.cer');
> #curl_setopt($ch, CURLOPT_CAINFO,'c:\exportedcertificate.pfx');
> #curl_setopt($ch, CURLOPT_CAINFO,'c:\server.keystore');
>
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

None of the options above concerns client certificates.

> curl_setopt($ch, CURLOPT_SSLCERT,'c:\certnew.cer');
> #curl_setopt($ch, CURLOPT_SSLCERT,'c:\certificate.pem');
> #curl_setopt($ch, CURLOPT_SSLCERT,'c:\exportedcertificate.pfx');
> #curl_setopt($ch, CURLOPT_SSLCERT,'c:\server.keystore');
>
> curl_setopt($ch, CURLOPT_SSLCERTPASSWD,'mypw');

I'm not an expert on this, but I think you need a private key as well when
using a cert.

Allow me to quote the curl_easy_setopt man page for CURLOPT_SSLCERTPASSWD:

       This option is replaced by CURLOPT_SSLKEYPASSWD and should only
       be used for backward compatibility. You never needed a pass
       phrase to load a certificate but you need one to load your pri-
       vate key.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2005-10-28