cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: FW: goddady.com, authorize.net and php curl setup options

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Thu, 25 Aug 2005 08:12:16 +0200 (CEST)

On Wed, 24 Aug 2005, Boris Glants wrote:

> I downloaded sample code from authorize.net however it doesn't work on the
> godaddy.com server. The same code runs fine on a server hosted at
> dreamhost.com. I narrowed it down and it is the curl part that is causing
> the problem. I made a sample test script.

I suggest you use the command line tool to work things out and then you
translate it to PHP when all things work. For two good reasons:

  1 - the curl command line tool has more advanced and capable debugging
      options such as --trace and family

  2 - you'll find more skilled curl tool users than you'll find PHP/CURL
      binding users, so you'll get more help and advice easier

And you're better off doing the PHP speak on the curl-and-php list.

> $ch = curl_init("https://certification.authorize.net/gateway/transact.dll
> <BLOCKED::https://certification.authorize.net/gateway/transact.dll> ");
>
> curl_setopt($ch, CURLOPT_HEADER, 0);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

Possibly you want to shut off the host name check of the certificate too, with
CURLOPT_SSL_VERIFYHOST.

> I don't have ssl from the domain I am running the script from, but I didn't
> think that would be a problem given that I set curl_setopt($ch,
> CURLOPT_SSL_VERIFYPEER, FALSE);

Uh? https:// requires SSL so your libcurl must've been built with SSL support
or it would understand the URL.

Besides, you should figure out the error code and error message libcurl
returns when it errors, as it will probably describe exactly why it failed.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-08-25