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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
47 - 15 = ?
Subscribe to this entry?

 
 [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-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC