You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ext/ftp: cryptic error on servers that don't support TLS session resumption on data connection #23619
logged in success
Warning: ftp_nlist: data_accept: failed to retrieve the existing SSL session
But I expected this output instead:
logged in success
[nlist output]
TLS session resumption on the data connection is required for it to be secure. GH-12851 fixed that. However, some servers don't seem to support TLS session resumption. In this case, PHP seems to fail with a cryptic-to-the-user error message. However, other FTP clients like i.e. FileZilla will prompt the user with a message like:
This server does not support TLS session resumption on the data connection.
TLS session resumption on the data connection is an important security feature to protect against data connection stealing attacks.
If you continue, transferred files may be intercepted or their contents replaced by an attacker.
I don't know if we want to support opting out of the behaviour (and certainly not continue insecurely silently), but we should definitely provide a better warning here, so users know what's wrong and what to blame.
A user reached out to me for support because this was "working" in PHP 8.1 (insecurely. probably) but stopped working when they upgraded to PHP 8.5, and thought it was a PHP issue. They did try it under 8.2.12 (last version XAMPP shipped) and that worked, and that was prior to when that PR was merged. I'm asking the user to bisect 8.2.13 vs. 8.2.14 to confirm.
As for the problematic FTP server in question, it seems to be Axway SecureTransport as installed by a large logistics company. A little hard to test for ourselves, and a little hard to get them to fix it. I don't know if we can force i.e. vsftpd to disallow session resumption to test it.
From what I remember, and take this with a grain of salt as this is a while ago, I tested vsftpd with both session resumption enabled or disabled and they both worked. I tested the PR both with a local server and a remote server that someone set up (the full transcript is somewhere in room11 probably).
Anyway, I agree to update the warning message and this can even be done in stable branches.
I think vsftpd always supports it and its INI option just is the difference between mandating it or not. I'm not aware of any FTP servers that let you outright disable it (other than that expensive broken one).
Activity
ndossche commentedon Sep 8, 2026
Fwiw, #12851 didn't introduce the warning, it was already there
NattyNarwhal commentedon Sep 8, 2026
Yeah, it's just only getting hit now. I think the stale session satisfied the condition so it didn't trigger the warning previously?
ndossche commentedon Sep 9, 2026
From what I remember, and take this with a grain of salt as this is a while ago, I tested vsftpd with both session resumption enabled or disabled and they both worked. I tested the PR both with a local server and a remote server that someone set up (the full transcript is somewhere in room11 probably).
Anyway, I agree to update the warning message and this can even be done in stable branches.
NattyNarwhal commentedon Sep 9, 2026
I think vsftpd always supports it and its INI option just is the difference between mandating it or not. I'm not aware of any FTP servers that let you outright disable it (other than that expensive broken one).
Fix phpGH-23619: ext/ftp: cryptic error on servers that don't support…
Merge branch 'PHP-8.4' into PHP-8.5
Merge branch 'PHP-8.5'