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

curl-and-php

AUTH TLS/SSL Isuues

From: Tom Griffin <gryphon5_at_bigfoot.com>
Date: Wed, 20 Sep 2006 17:25:24 +0100

Hello,

I am new to this group and apologise if this has already been dealt with
previously.

I am trying to use the PHP/CURL library to list a directory using AUTH
SSL (or TLS) over FTP.

Here are the options I am setting;
curl_setopt($ch, CURLOPT_FTPLISTONLY, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_INTERFACE, 'eth0');
curl_setopt($ch, CURLOPT_FTPPORT, 'eth0');
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_TLS);
curl_setopt($ch, CURLOPT_URL, "ftp://user:pass@private-ftp:2100/");

I have tried several combinations of the CURLOPT_FTPSSLAUTH option and I
have also attempted to use the CURLOPT_FTP_SSL option. With every
attempt, the FTP login doesn't even try to use the AUTH TLS/SSL command
before sending the user/pass - here is a debug;

* About to connect() to private-ftp port 2100
* Trying 83.233.36.1... * We bind local end to 195.242.220.1
* connected
* Connected to private-ftp (83.233.36.1) port 9100
< 220 FTP Ready
> USER user
< 530 USE SECURE CONNECTION
* Access denied: 530
* Closing connection #0

Here is a list of the versions I am using;
curl 7.13.2 (i386-pc-linux-gnu) libcurl/7.13.2 OpenSSL/0.9.7e zlib/1.2.2
libidn/0.5.13
PHP 5.1.6-0.dotdeb.2 (cli) (built: Aug 31 2006 17:18:42)

According to the PHP documentation, these versions are sufficient to use
the CURLOPT_FTPSSLAUTH option.
(http://uk2.php.net/manual/en/function.curl-setopt.php => CURL 7.12.2
and PHP 5.1.0.)

Note that when I use the --ftp-ssl flag with curl at the command line,
the AUTH SSL command is sent to the server just fine. But when using the
PHP/CURL library it seems to simply ignore the option.

Am I configuring it wrong, do need to upgrade or is this a known issue?
I could theoretically use the shell_exec(); command and run curl from
the shell, but thats not as robust and the library method is preferred.

Any help would be gratefully appreciated.

Many thanks,
Tom

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-09-20