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

Add support for OpenSSL 3 SSL_OP_IGNORE_UNEXPECTED_EOF option #9024

Closed
walkonthemarz opened this issue Jun 17, 2022 · 3 comments
Closed

Add support for OpenSSL 3 SSL_OP_IGNORE_UNEXPECTED_EOF option #9024

walkonthemarz opened this issue Jun 17, 2022 · 3 comments

Comments

@walkonthemarz
Copy link

The OpenSSL 3 has added the SSL_OP_IGNORE_UNEXPECTED_EOF option, should curl also add the option to support that?
I'm creating this because the issue #5138 and #7800 was closed.
I am using PHP curl extension which relies on this lib and upgrade my OpenSSL to version 3 then I am getting through the curl: (56) OpenSSL SSL_read: error:0A000126:SSL routines::unexpected eof while reading, errno 0 error.
I am thinking if curl can add the option then the PHP curl extension may have the possibility to expose the option to PHP users and PHP users can have a choice to decide whether to turn on the option.

@walkonthemarz walkonthemarz changed the title Add SSL_OP_IGNORE_UNEXPECTED_EOF option to support OpensSSL 3 Add support for OpensSSL 3 SSL_OP_IGNORE_UNEXPECTED_EOF option Jun 17, 2022
@walkonthemarz walkonthemarz changed the title Add support for OpensSSL 3 SSL_OP_IGNORE_UNEXPECTED_EOF option Add support for OpenSSL 3 SSL_OP_IGNORE_UNEXPECTED_EOF option Jun 17, 2022
@TomooNomura
Copy link

At this time, there is no measures to set SSL_OP_IGNORE_UNEXPECTED_EOF option by php curl / php http, isn't it ?
Is there any other ways to set it ?
I'm very glad if someone helps me.
Thanks.

@tiemez
Copy link

tiemez commented Oct 4, 2022

to resolve this isssue with the PHP curl extension for php7.4 on Ubuntu 22.04.1 LTS (jammy) , i've changed the php-curl extension to add the SSL_OP_IGNORE_UNEXPECTED_EOF flag as follows

apt install php7.4-dev && apt install libcurl4-openssl-dev && wget https://www.php.net/distributions/php-7.4.32.tar.gz) && tar xfz php-7.4.32.tar.gz && cd php-7.4.32/ext/curl/

in php-7.4.32/ext/curl/interface.c

i've added a ssl-context-function

static CURLcode rslctx(CURL *curl, void *sslctx, void parm)
{
SSL_CTX_set_options((SSL_CTX
) sslctx, SSL_OP_IGNORE_UNEXPECTED_EOF);
return CURLE_OK;
}

and added

curl_easy_setopt(ch->cp, CURLOPT_SSL_CTX_FUNCTION, rslctx); to the _php_curl_set_default_options method

replace interface.c with my version and then

phpize && ./configure && make && make install

afterwards reload the service (in case you're using php7.4-fpm or libapache-mod-php7.4)

@bagder
Copy link
Member

bagder commented Nov 25, 2022

Thanks, but this description sounds as if you're asking for a new feature/change. We use this tracker for bugs and issues only, we put ideas to work on in the future in the TODO document. We basically drown in good ideas so they don't do much use in our tracker.

If you really want to see this happen, start working on an implementation and submit a PR for it or join the mailing list and talk up more interest for it and see what help from others you can get!

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

No branches or pull requests

4 participants