-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix #80880: SSL_read on shutdown, ftp/proc_open #6803
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
Conversation
When `SSL_read()` after `SSL_shutdown()` fails with `SSL_ERROR_SYSCALL`, we should not warn about this on Windows for `WSAECONNABORTED`.
Oh forgot to mention that adding a test for a Windows specific FTP issue wouldn't make sense, since the FTP test suite doesn't run there anyway. :( |
I'm not sure either. Maybe we should simply bail out without any warning message at all (unless we receive |
That may indeed be a better solution, although a meaningful error message might help users to indentify the problem. Anyhow, the php_openssl_sockop_close() is totally different from the FTP shutdown. After SSL_shutdown() there are no further SSL_read()s, and on Windows receives are even shutdown: Lines 2279 to 2319 in ac47162
Maybe @bukka has some idea about how to implement a proper SSL shutdown? |
Yeah I think you should just bail out on all platforms if there's SSL_ERROR_SYSCALL. I think the I have been also looking to FTP handling and there are quite a lot of duplication so it would be good to maybe switch it to use stream internally once the shutdown is handled there as well. Btw. this SSL_ERROR_WANT_READ logic (polling) might not be needed from 1.1.1 where |
Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>
Thanks, @bukka! I've implemented an uncoditional bailout on SSL_ERROR_SYSCALL now. Regarding ext/ftp: not sure how much work we should put into this. I assume that SFTP is more important nowadays, and that the need for FTPS will further decrease. We may want consider to deprecate the extension (and maybe want to consider whether to bundle ext/ssh2 instead). Those still needing FTP(S) have still basic support via streams. |
Looks good! Just noted that it might be worth to mention the reason in the comment.
I think the extension is quite widely used so I don't agree that it should be deprecated. The sftp api in ext/ssh2 is not that straight forward but might be good idea to add that ext to core as it has got some other advantages. If it exposes the API, it could be potentially used by ftp ext. You are right that FTPS is not that used, was just thinking that it would be better to have it in a single place. Anyway this is probably not the best place to discuss it :) |
I agree that deprecating ext/ftp and/or bundling ext/ssh2 should not be discussed here. :) |
When
SSL_read()
afterSSL_shutdown()
fails withSSL_ERROR_SYSCALL
,we should not warn about this on Windows for
WSAECONNABORTED
.I'm not sure whether this is a Windows specific issue, or whether
SSL_ERROR_SYSCALL
may happen on other systems as well, so I went with a Windows specific patch. @manuelm, since you've implemented the proper SSL shutdown, maybe you want to have a look.