-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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:0A000126:SSL routines::unexpected eof while reading in php #18574
Comments
It has nothing to do with legacy provider. SSL_OP_IGNORE_UNEXPECTED_EOF is the corresponding flag to ignore this error, see https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_options.html for more information |
This error is popping up all over GitHub and StackOverflow, I don't know why this issue is marked "resolved"... it seems there is a bug in OpenSSL that requires upgrading and/or downgrading packages, and/or rebooting. Ref: curl/curl#5138 ...among several other threads. It seems to happen in both 1.1.1d and 1.1.1e, possibly other versions. Edit: this comment seems relevant:
P.S. Rumors are that 1.1.1f (v3.0.x) fixes this issue but I just came across it on Ubuntu 22.04 and OpenSSL 3.0.2 so I'm not sure if this was ever truly resolved or not. |
Not rumors but facts: 1.1.1f reverted the behavior the error is reported. The error is really an error of the peer. 3.0.x requires the application to set the SSL_OP_IGNORE_UNEXPECTED_EOF to ignore the error. |
Can anyone show me how to set the SSL_OP_IGNORE_UNEXPECTED_EOF to the ssl.h ? |
The application has to set it. It has to call |
You're editing an OpenSSL header file, not modifying the application calling the OpenSSL. Anyway, this should be done by the application developer, not by user. |
Oh I got it. Well when I downgraded it to an older version of openssl it still didn't work. Do you know a version where it deffinetly won't make problems? |
Use the latest 1.1.1 release (1.1.1q). |
Ubuntu 22.04 comes with OpenSSL 3, and the specific version that PHP is built against has a bug which has since been fixed but isn't showing up in the images that GitHub has available. See openssl/openssl#18574 and php/php-src#8369
I have built a website in PHP using the YII2 framework. When I use file_get_contents($requestUrl, false, stream_context_create($arrContextOptions)) then i am getting error saying error:0A000126:SSL routines::unexpected eof while reading I have also tried to enable the legacy provider by editing the openssl.cnf file, but got no success. Reference: https://gist.github.com/rdh27785/97210d439a280063bd768006450c435d
Here is the screenshot
Server: Nginx (nginx/1.18.0)
OS: Ubuntu 22.04 LTS
PHP: 7.4.29
Openssl: 1.1.1d
The text was updated successfully, but these errors were encountered: