Skip to content
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

Error when sending large chunks of data over a secure TLS connection with older PHP versions #105

Closed
clue opened this issue May 19, 2017 · 1 comment · Fixed by #114
Closed
Assignees
Labels
Milestone

Comments

@clue
Copy link
Member

clue commented May 19, 2017

Originally reported here: reactphp/stream#64

This can actually easily be reproduced by sending a "large" chunk of data at once over a TLS connection. On my system, this appears to be anything larger than around 30 KB at once passed to the underlying fwrite() call.

error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry

This is actually a bug in PHP that has been reported via https://bugs.php.net/bug.php?id=72333. The bug has been present for years and has been fixed recently via php/php-src@17e9fc9 which landed in 7.1.4 and 7.0.18.

I've played around with different buffers and write chunks and it looks like this can be worked around by limiting the write chunk size to anything smaller than around 8 KB.

@clue
Copy link
Member Author

clue commented May 19, 2017

Note that this has only been fixed recently in 7.1.4 and 7.0.18, which means there are plenty of versions that are still affected by this issue. As such, I believe it makes sense to provide a work around for affected versions here.

The work around requires limiting the maximum chunk size to write at once. This feature PR is currently outstanding here: reactphp/stream#105

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 a pull request may close this issue.

1 participant