php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55188 ftp_ssl_connect doesn't work
Submitted: 2011-07-12 10:53 UTC Modified: -
Votes:12
Avg. Score:4.2 ± 0.8
Reproduced:10 of 11 (90.9%)
Same Version:4 (40.0%)
Same OS:5 (50.0%)
From: gabriele dot brosulo at gmail dot com Assigned:
Status: Open Package: FTP related
PHP Version: 5.3.6 OS: Debian
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-07-12 10:53 UTC] gabriele dot brosulo at gmail dot com
Description:
------------
ftp_ssl_connect returns a correct FTP Buffer, ftp_login returns true, but ftp_nlist doesn't list the files.

Using the same code but ftp_connect works.

Connecting to the server through a normal client (eg. Filezilla) works in SSL.

The problem is found on a debian squeeze, php5 version 5.3.6-12.

Test script:
---------------
$ftp = 'ftp.test.net';
$usr = 'username';
$pwd = 'password';

// Connessione
$conn_id = ftp_connect($ftp,21,1200);
echo "Risultato connessione: \n<br/>";
var_dump($conn_id);

// Login
$login_result = ftp_login($conn_id, $usr, $pwd);
echo "Risultato login: ";
var_dump($login_result);

// Passive mode
ftp_pasv($conn_id, true);

if ($conn_id !== false && $login_result !== false) {
  // Lista dei file
  $files = ftp_nlist($conn_id,'.');
  echo "\n<br/>Contenuto dir: ";
  var_dump($files);
}
    
// Chiudo la connessione
ftp_close($conn_id);

echo "<br/><br/>";

// Connessione SSL
$conn_id = ftp_ssl_connect($ftp,21,1200);
echo "\n<br/>Risultato connessione SSL: ";
var_dump($conn_id);

// Login
$login_result = ftp_login($conn_id, $usr, $pwd);
echo "\n<br/>Risultato login: ";
var_dump($login_result);

// Passive mode
ftp_pasv($conn_id, true);

if ($conn_id !== false && $login_result !== false) {
  // Lista dei file
  $files = ftp_nlist($conn_id,'.');
  echo "\n<br/>Contenuto dir: ";
  var_dump($files);
}
    
// Chiudo la connessione
ftp_close($conn_id);

Expected result:
----------------
The same result in both ftp_connect and ftp_ssl_connect

Actual result:
--------------
Risultato connessione:
resource(14) of type (FTP Buffer) Risultato login: bool(true)
Contenuto dir: array(3) { [0]=> string(12) "test2" [1]=> string(8) "ipaq.zip" [2]=> string(7) "prova" }


Risultato connessione SSL: resource(16) of type (FTP Buffer)
Risultato login: bool(true)
Contenuto dir: bool(false) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 21:01:26 2019 UTC