php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77151 ftp_close(): SSL_read on shutdown
Submitted: 2018-11-14 12:29 UTC Modified: 2018-11-15 06:20 UTC
Votes:3
Avg. Score:4.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:3 (100.0%)
From: ja at vojta-tuma dot cz Assigned:
Status: Closed Package: FTP related
PHP Version: 7.1.24 OS: irrevelant
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ja at vojta-tuma dot cz
New email:
PHP Version: OS:

 

 [2018-11-14 12:29 UTC] ja at vojta-tuma dot cz
Description:
------------
ftp_close() function returns warning while trying to close SSL connection.
Exact stdout:
ftp_close(): SSL_read on shutdown

I run following testscript with latest docker php7-cli image.
docker run --rm -v ./code/:/code/ php:7-cli php /code/test.php

Test script:
---------------
<?php
$ftp_conn = ftp_ssl_connect('server');
$ftp_login = ftp_login($ftp_conn, 'user', 'pass');
echo ftp_pwd($ftp_conn);
ftp_close($ftp_conn);


Expected result:
----------------
print working directory without any error

Actual result:
--------------
print working directory and warning message on ftp close.

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-11-14 15:04 UTC] cmb@php.net
The respective code[1] looks fishy.  Shouldn't the
php_error_docref() be inside the if statement?

[1] <https://github.com/php/php-src/blob/php-7.2.12/ext/ftp/ftp.c#L1931-L1934>
 [2018-11-14 22:12 UTC] cmb@php.net
> The respective code[1] looks fishy.

Likely a false alarm, see
<https://github.com/php/php-src/pull/3575/files#r233561470>.
 [2018-11-14 22:25 UTC] manuel-php at mausz dot at
I can't reproduce this here. But my setup is fairly limited and I'm running the latest releases only.

What's the full error message? "SSL_read on shutdown" is truncated. There should be a readable system/openssl error message + corresponding error number.
 [2018-11-15 06:20 UTC] remi@php.net
Also get reports abnout this warning:

     PHP Warning:  ftp_close(): SSL_read on shutdown: Success (0) in import.php on line 62

Also see my comments on the https://github.com/php/php-src/commit/bb4a2e8bb7fc80fa5b3725508bcc8fea525f059b
 [2018-11-15 06:20 UTC] remi@php.net
-Operating System: debian +Operating System: irrevelant -PHP Version: 7.2.12 +PHP Version: 7.1.24
 [2018-11-19 12:10 UTC] jsoumelidis at gmail dot com
Also affects ftp_put()
 [2018-11-20 10:21 UTC] remi@php.net
Automatic comment on behalf of remi@remirepo.net
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d9afc2f662587a042db38c8f0df98a27bfc89d29
Log: Fix #77151 ftp_close(): SSL_read on shutdown
 [2018-11-20 10:21 UTC] remi@php.net
-Status: Open +Status: Closed
 [2018-11-30 15:42 UTC] f dot bosch at genkgo dot nl
We are also seeing this issue. It also involves ftp_put, instead of ftp_close. It is happening since the upgrade to 7.1.24 and seems therefore related to this issue.

PHP Warning:  ftp_fput(): SSL_read on shutdown: Connection reset by peer (104)

PHP Warning:  ftp_fput(): Data channel timed out due to not meeting the minimum bandwidth requirement.

PHP Warning:  ftp_close(): SSL_read on shutdown: Success (0)
 [2022-01-05 08:20 UTC] mariem dot chaa at gmail dot com
I have same problem for ftp_mlsd , any suggestions please ?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 15:01:30 2024 UTC