php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72764 ftps:// opendir wrapper data channel encryption fails with IIS FTP 7.5, 8.5
Submitted: 2016-08-05 13:05 UTC Modified: -
From: vhu at iki dot fi Assigned:
Status: Closed Package: Streams related
PHP Version: 5.6.25RC1 OS: *
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: vhu at iki dot fi
New email:
PHP Version: OS:

 

 [2016-08-05 13:05 UTC] vhu at iki dot fi
Description:
------------
Fix for bug #72667 changed the FTP/FTPS wrapper php_stream_ftp_opendir() so that the data channel is opened immediately after the PASV/EPSV command. If FTPS is enabled, data channel encryption is negotiated immediately after opening the data channel.

IIS FTP server and ProFTPD only allow TLS negotiation after NLST command has been issued and data ready to be transmitted. As it is, FTPS opendir() and scandir() against IIS or ProFTPD effectively hang until the negotiation times out.


Test script:
---------------
<?php
foreach (scandir('ftps://example.com/') as $fn) {
  print $fn ."\n";
}


Expected result:
----------------
file1
file2
file3

Actual result:
--------------
Warning: scandir(): SSL: Handshake timed out in test.php on line 2

Warning: scandir(ftps://example.com/): failed to open dir: Unable to activate SSL mode in test.php on line 2

Warning: scandir(): (errno 0): Success in test.php on line 2

Warning: Invalid argument supplied for foreach() in test.php on line 2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-05 13:25 UTC] vhu at iki dot fi
There is a PR#2058 for this: https://github.com/php/php-src/pull/2058
 [2016-08-05 21:10 UTC] nikic@php.net
Automatic comment on behalf of ville@fihells01.fi.dhl.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=65056e9d6c74adef89332080b5458fd4850fb3b7
Log: Fix #72764
 [2016-08-05 21:10 UTC] nikic@php.net
-Status: Open +Status: Closed
 [2016-08-18 11:15 UTC] tyrael@php.net
Automatic comment on behalf of ville@fihells01.fi.dhl.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=869c547681f9fad24e141d7eb3571e3bba40fb78
Log: Fix #72764
 [2016-10-17 10:10 UTC] bwoebi@php.net
Automatic comment on behalf of ville@fihells01.fi.dhl.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=65056e9d6c74adef89332080b5458fd4850fb3b7
Log: Fix #72764
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 18:01:28 2024 UTC