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: 2021-02-28 04:22 UTC
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: cmb (profile)
Status: No Feedback Package: FTP related
PHP Version: 5.3.6 OS: Debian
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gabriele dot brosulo at gmail dot com
New email:
PHP Version: OS:

 

 [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

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-02-17 15:56 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-02-17 15:56 UTC] cmb@php.net
Is this still an issue with any of the actively supported PHP
versions[1]?

[1] <php.net/supported-versions.php>
 [2021-02-28 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Mar 05 14:01:23 2021 UTC