Skip to content

Fix #78374: Warning when closing FTPS connection after FTP_PUT #7362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Aug 12, 2021

ftp_ssl_shutdown() attempts a bidirectional shutdown handshake, i.e.
we're sending a close_notify alert, and then wait for the peer to send
its close_notify alert. If the peer doesn't sent it, typically because
it already closed the connection, we should not raise a warning, but
rather ignore this condition.


Note that the test case is somewhat bogus as it wouldn't fail without the changes to ftp.c; I wouldn't know how to accomplish that. Still, the test case makes some sense on its own, since it tests uploading via FTPS.

`ftp_ssl_shutdown()` attempts a bidirectional shutdown handshake, i.e.
we're sending a close_notify alert, and then wait for the peer to send
its close_notify alert.  If the peer doesn't sent it, typically because
it already closed the connection, we should not raise a warning, but
rather ignore this condition.
@cmb69 cmb69 added the Bug label Aug 12, 2021
@nikic
Copy link
Member

nikic commented Aug 12, 2021

New test fails on azure.

The latter might not be supported by the OpenSSL library.
@cmb69
Copy link
Member Author

cmb69 commented Aug 12, 2021

Thanks! I've pushed a potential fix.

@cmb69
Copy link
Member Author

cmb69 commented Aug 12, 2021

Nope, that wasn't the issue. This may get funny.

@cmb69 cmb69 marked this pull request as draft August 12, 2021 14:13
@cmb69
Copy link
Member Author

cmb69 commented Aug 31, 2021

Apparently, the test fails only with OpenSSL 1.1, but passes with OpenSSL 1.0. I have no idea why, though. Any hints appreciated!

@cmb69 cmb69 closed this Sep 7, 2021
@markus-angst
Copy link

From the comments above, I cannot conclude what the findings are with regard to the problem. I still get the warning. Apache/2.4.57 (Win64) OpenSSL/1.1.1t PHP/8.3.17. OpenSSL Library Version: OpenSSL 3.0.15 3 Sep 2024. Is this pull request closed, because there is no solution (yet)? Or is there a newer PHP version with a fix? I can't find anything in the PHP version history. Any help would be appreciated. Thanks!

@cmb69
Copy link
Member Author

cmb69 commented Aug 13, 2025

Indeed, this bug has still not been fixed; I had given up on it.

Apache/2.4.57 (Win64) OpenSSL/1.1.1t PHP/8.3.17. OpenSSL Library Version: OpenSSL 3.0.15 3 Sep 2024.

Which OpenSSL version is it, 1.1.1t or 3.0.15?

@markus-angst
Copy link

markus-angst commented Aug 13, 2025

Sorry for being ambiguous.
In phpinfo() the "apache2handler" section reports: Apache Version | Apache/2.4.57 (Win64) OpenSSL/1.1.1t PHP/8.3.17.
And the "openssl" extension reports: OpenSSL Library Version | OpenSSL 3.0.15 3 Sep 2024.
I am ready to find out more, if needed (and possible).

@markus-angst
Copy link

markus-angst commented Aug 13, 2025

In C:\Program Files\Apache Software Foundation\Apache_2.4.57_VS16\bin I have libssl-1_1-x64.dll. (Version 1.1.1t). This file came with Apache.
In C:\Program Files\php_8.3.17_VS16 I have libssl-3-x64.dll. (Version 3.0.15)This file came with PHP. (The PHP FTP extension php_ftp.dll depends on libssl-3-x64.dll.)
C:\Program Files\php_8.3.17_VS16 is in the path; C:\Program Files\Apache Software Foundation\Apache_2.4.57_VS16\bin is not, but that's where httpd.exe is located.

(All my FTP functions work so far, except for this warning.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants