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

curl-and-php

Re: Please Help

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 1 Dec 2005 23:32:16 +0100 (CET)

On Thu, 1 Dec 2005, Ross Chatfield wrote:

> I want to send XML string to a server that require a .PEM file.

Servers don't actually require "PEM" files. They require certificates if that
is what you mean.

> But I never get a response from the server and get error : (58) unable to
> set certificate file (wrong password?).

You need to pass both certificate and key, and the key has a password you
must set.

> I've tried using
> curl_setopt ($ch, CURLOPT_CAINFO, "c:\\windows\\ca-bundle.crt");
> curl_setopt ($ch, CURLOPT_CAPATH, "c:\\windows\\ca-bundle.crt");
> curl_setopt ($ch, CURL_CA_BUNDLE, "c:\\windows\\ca-bundle.crt");
> but still no luck.

You seem to be confusing matters. Those options are about the CA cert and your
server cannot require such.

Besides, the last one above is not a valid option.

> If I commented out the curl_setopt ($ch, CURLOPT_SSLCERT, $cert) line, I
> got a response from the server saying I can't access it since there's no
> .pem file.

So set the cert, key and passphrase and it probably works!

> So, is this an error from my server or from the other server?

libcurl only speaks to the server you tell it to, so if you get a response it
comes from that single server.

-- 
  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-12-01