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

It's time to upgrade openssl to version 3.0.x! #929

Open
goodve opened this issue Oct 7, 2023 · 19 comments
Open

It's time to upgrade openssl to version 3.0.x! #929

goodve opened this issue Oct 7, 2023 · 19 comments

Comments

@goodve
Copy link

goodve commented Oct 7, 2023

It is well known that openssl version 1.x has been end of life.
In the meantime, nginx has been actively upgraded to openSSL 3.0.x
image

@computinglife
Copy link

Any timelines for this please? This is becoming a blocker

@goodve
Copy link
Author

goodve commented Oct 13, 2023

Any timelines for this please? This is becoming a blocker
All older versions (including 1.1.0, 1.0.2, 1.0.0 and 0.9.8) are now out of support and should not be used. Users of these older versions are encouraged to upgrade to 3.1 or 3.0 as soon as possible. Extended support for 1.1.1 and 1.0.2 to gain access to security fixes for that version is available.

refer to https://www.openssl.org/source/

@computinglife
Copy link

Well, the extended support from openssl is hardly practical since we / others use the OpenREsty binary directly since custom Lua builds is heavily discouraged according to the official documentation, due to the complexity involved.

So the OpenResty images are the only source for kosher builds containing latest versions of OpenSSL. The later builds are also importance from compliance perspective and it is not just a question of support.

@goodve
Copy link
Author

goodve commented Oct 13, 2023

Well, the extended support from openssl is hardly practical since we / others use the OpenREsty binary directly since custom Lua builds is heavily discouraged according to the official documentation, due to the complexity involved.

So the OpenResty images are the only source for kosher builds containing latest versions of OpenSSL. The later builds are also importance from compliance perspective and it is not just a question of support.

Currently, countries around the world are paying close attention to network security. openssl1.x may be directly disabled if it fails the security baseline test, and if it cannot be upgraded. Is it possible to find a way to cheat the test, for example, just change the version number 🤣🤣🤣🤣🤣🤣🤣

@computinglife
Copy link

Do we know if this work is planned ? Is someone working on this ? Can we help in any ways possible ?

@devhaozi
Copy link
Contributor

Do we know if this work is planned ? Is someone working on this ? Can we help in any ways possible ?

They promised in a previous issue to release 1.25.x before the end of the year.

@computinglife
Copy link

Do we know if this work is planned ? Is someone working on this ? Can we help in any ways possible ?

They promised in a previous issue to release 1.25.x before the end of the year.

Can you please share a reference to this promise, so that i can check in on it whenever i need to get tensed up in my free time ?

@devhaozi
Copy link
Contributor

devhaozi commented Oct 27, 2023

Do we know if this work is planned ? Is someone working on this ? Can we help in any ways possible ?

They promised in a previous issue to release 1.25.x before the end of the year.

Can you please share a reference to this promise, so that i can check in on it whenever i need to get tensed up in my free time ?

#905 (comment)
#905 (comment)

@tiwarivikash
Copy link

@zhuizhuhaomeng Can you please comment if OpenSSL 3 upgrade is going to be part of Nginx 1.25.x upgrade?

@zhuizhuhaomeng
Copy link
Contributor

At least, there are two things to do:
Port openssl-1.1.1f-sess_set_get_cb_yield.patch to OpenSSL 3.x.
Test the performance of OpenSSL 3.x to make sure there is not much regression.

If anyone can submit a PR, it would be appreciated!

@luisgoncalves
Copy link

Hi,

Just wanted to confirm I got things right.. In the latest openresty Docker images I get:

> nginx -V
nginx version: openresty/1.25.3.1
built by gcc 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
built with OpenSSL 1.1.1w  11 Sep 2023

So, although Openresty 1.25.3.1 is based on Nginx 1.25.3, for which there are builds using OpenSSL 3.X, Openresty itself is still built against OpenSSL 1.1.1. Currently, there's no oficial Docker image using OpenSSL 3.X.

Is my understanding correct? Thanks.

@Faq
Copy link

Faq commented Jun 29, 2024

Seems @luisgoncalves is right.

Also dropping from forum:

OpenSSL 3.0 has performance regression.
So we don't upgrade to OpenSSL 3.0.

@centminmod
Copy link

centminmod commented Jul 15, 2024

Just chiming in with my 2 cents

Now that OpenSSL 1.1.1 is EOL with 1.1.1w being the last public release, curious what are OpenResty and Lua Nginx's ssl* plans for the future, and what will you upgrade the base to? Several projects also discuss their futures beyond OpenSSL 1.1.1 at haproxy/haproxy#2294 and quictls/quictls#14.

I ask as my Nginx builds, which have optional Lua Nginx modules support, can be compiled against the following crypto libraries below. But naturally, not all are expected to be supported by Lua Nginx.

Personally, for my own Nginx builds, I am leaning towards https://github.com/aws/aws-lc, which combines the best of BoringSSL and OpenSSL 1.1.1 code base with HTTP/2 and HTTP/3 QUIC support and retaining OCSP stapling support and dual RSA + ECDSA SSL certificate support which BoringSSL ripped out. AWS-LC is also the easiest and fastest to compile too! 😎

Amazon AWS-LC team are also focussing on compatibility with a lot of common software including Nginx and nginx patches - see https://github.com/aws/aws-lc/tree/main/tests/ci/integration and they're FIPS 140-3 certificated https://aws.amazon.com/blogs/security/aws-lc-is-now-fips-140-3-certified/

FYI, performance wise AWS-LC > BoringSSL > OpenSSL/quicTLS 1.1.1 > OpenSSL/quicTLS 3.3 > 3.2 > 3.1 >3.0 > LibreSSL. So if you're worried about performance regressions in OpenSSL 3.0-3.3, then my choice is still AWS AWS-LC 😃

@devhaozi
Copy link
Contributor

devhaozi commented Sep 4, 2024

Just chiming in with my 2 cents

Now that OpenSSL 1.1.1 is EOL with 1.1.1w being the last public release, curious what are OpenResty and Lua Nginx's ssl* plans for the future, and what will you upgrade the base to? Several projects also discuss their futures beyond OpenSSL 1.1.1 at haproxy/haproxy#2294 and quictls/quictls#14.

I ask as my Nginx builds, which have optional Lua Nginx modules support, can be compiled against the following crypto libraries below. But naturally, not all are expected to be supported by Lua Nginx.

Personally, for my own Nginx builds, I am leaning towards https://github.com/aws/aws-lc, which combines the best of BoringSSL and OpenSSL 1.1.1 code base with HTTP/2 and HTTP/3 QUIC support and retaining OCSP stapling support and dual RSA + ECDSA SSL certificate support which BoringSSL ripped out. AWS-LC is also the easiest and fastest to compile too! 😎

Amazon AWS-LC team are also focussing on compatibility with a lot of common software including Nginx and nginx patches - see https://github.com/aws/aws-lc/tree/main/tests/ci/integration and they're FIPS 140-3 certificated https://aws.amazon.com/blogs/security/aws-lc-is-now-fips-140-3-certified/

FYI, performance wise AWS-LC > BoringSSL > OpenSSL/quicTLS 1.1.1 > OpenSSL/quicTLS 3.3 > 3.2 > 3.1 >3.0 > LibreSSL. So if you're worried about performance regressions in OpenSSL 3.0-3.3, then my choice is still AWS AWS-LC 😃

In my test results, OpenResty 1.25.3.1 + QUIC can work well with OpenSSL 3.x. I will test BoringSSL and aws-lc in the future.

@devhaozi
Copy link
Contributor

devhaozi commented Sep 5, 2024

Just chiming in with my 2 cents
Now that OpenSSL 1.1.1 is EOL with 1.1.1w being the last public release, curious what are OpenResty and Lua Nginx's ssl* plans for the future, and what will you upgrade the base to? Several projects also discuss their futures beyond OpenSSL 1.1.1 at haproxy/haproxy#2294 and quictls/quictls#14.
I ask as my Nginx builds, which have optional Lua Nginx modules support, can be compiled against the following crypto libraries below. But naturally, not all are expected to be supported by Lua Nginx.

Personally, for my own Nginx builds, I am leaning towards https://github.com/aws/aws-lc, which combines the best of BoringSSL and OpenSSL 1.1.1 code base with HTTP/2 and HTTP/3 QUIC support and retaining OCSP stapling support and dual RSA + ECDSA SSL certificate support which BoringSSL ripped out. AWS-LC is also the easiest and fastest to compile too! 😎
Amazon AWS-LC team are also focussing on compatibility with a lot of common software including Nginx and nginx patches - see https://github.com/aws/aws-lc/tree/main/tests/ci/integration and they're FIPS 140-3 certificated https://aws.amazon.com/blogs/security/aws-lc-is-now-fips-140-3-certified/
FYI, performance wise AWS-LC > BoringSSL > OpenSSL/quicTLS 1.1.1 > OpenSSL/quicTLS 3.3 > 3.2 > 3.1 >3.0 > LibreSSL. So if you're worried about performance regressions in OpenSSL 3.0-3.3, then my choice is still AWS AWS-LC 😃

In my test results, OpenResty 1.25.3.1 + QUIC can work well with OpenSSL 3.x. I will test BoringSSL and aws-lc in the future.

Result:
OpenSSL 3.0/3.3 = support
BoringSSL = support
QuicTLS 1.1.1 = support
AWS-LC = not support, error log:

../ngx_lua-0.10.27/src/ngx_http_lua_ssl_export_keying_material.c: In function ‘ngx_http_lua_ffi_ssl_export_keying_material_early’:
../ngx_lua-0.10.27/src/ngx_http_lua_ssl_export_keying_material.c:108:10: warning: implicit declaration of function ‘SSL_export_keying_material_early’; did you mean ‘SSL_export_keying_material’? [-Wimplicit-function-declaration]
  108 |     rc = SSL_export_keying_material_early(ssl_conn, out, out_size,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |          SSL_export_keying_material
../ngx_lua-0.10.27/src/ngx_http_lua_ssl_ocsp.c: In function ‘ngx_http_lua_ffi_ssl_set_ocsp_status_resp’:
../ngx_lua-0.10.27/src/ngx_http_lua_ssl_ocsp.c:517:17: error: invalid use of incomplete typedef ‘SSL’ {aka ‘struct ssl_st’}
  517 |     if (ssl_conn->tlsext_status_type == -1) {
      |                 ^~
cc -c -I/www/server/openresty/src/build/luajit-root/www/server/openresty/luajit/include/luajit-2.1 -I/www/server/openresty/src/build/luajit-root/www/server/openresty/luajit/include/luajit-2.1  -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -g -O2 -DNGX_LUA_ABORT_AT_PANIC -march=native -mtune=native -Ofast -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections -I/root/aws-lc-install/include -DNDK_SET_VAR -DNDK_UPSTREAM_LIST -DNDK_SET_VAR -DNDK_SET_VAR -DNDK_SET_VAR -DNDK_SET_VAR -Wno-deprecated-declarations  -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I ../ngx_devel_kit-0.3.3/objs -I objs/addon/ndk -I ../ngx_lua-0.10.27/src/api -I ../ngx_stream_lua-0.0.15/src/api -I /www/server/openresty/src/pcre2/src/ -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 -I src/http/v3 -I ../ngx_devel_kit-0.3.3/src -I ../ngx_devel_kit-0.3.3/src -I ../ngx_devel_kit-0.3.3/objs -I objs/addon/ndk -I /www/server/openresty/src/build/luajit-root/www/server/openresty/luajit/include/luajit-2.1 -I /www/server/openresty/src/ngx_brotli/deps/brotli/c/include -I /www/server/openresty/ngx_waf/inc -I /www/server/openresty/src/uthash/include -I /www/server/openresty/ngx_waf/inc/libinjection/src -I src/stream -I /www/server/openresty/src/build/luajit-root/www/server/openresty/luajit/include/luajit-2.1 \
        -o objs/addon/src/ngx_http_lua_ssl.o \
        ../ngx_lua-0.10.27/src/ngx_http_lua_ssl.c
make[2]: *** [objs/Makefile:3081: objs/addon/src/ngx_http_lua_ssl_ocsp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/www/server/openresty/src/build/nginx-1.27.1'
make[1]: *** [Makefile:10: build] Error 2
make[1]: Leaving directory '/www/server/openresty/src/build/nginx-1.27.1'
make: *** [Makefile:11: all] Error 2

I have open a PR(openresty/lua-nginx-module#2357) to fix it.

@Faq
Copy link

Faq commented Sep 6, 2024

@devhaozi how did you tested it, can you share that in isolated environment like Docker file in gist?
As in https://openresty.org/en/changelog-1025003.html is nothing about supporting OpenSSL 3

@devhaozi
Copy link
Contributor

devhaozi commented Sep 6, 2024

@devhaozi how did you tested it, can you share that in isolated environment like Docker file in gist? As in https://openresty.org/en/changelog-1025003.html is nothing about supporting OpenSSL 3

Pls refer to my PR, there is no problem with the basic functions, but test 140 failed, current not clear whether it is an AWS-LC problem?

And OpenResty support OpenSSL 3 since 1.25, but they don't use it in production due to performance regressions.
image

@devhaozi
Copy link
Contributor

devhaozi commented Oct 22, 2024

OpenResty 1.27.1.1 has been released and this issue can be closed.

https://openresty.org/en/ann-1027001001.html

@computinglife
Copy link

computinglife commented Nov 18, 2024

Great news !!

Can you please advice if the performance issues referred to above is now fixed ?

I would be very much interested to know if 1.27.1.1 has the 3.0 OpenSSL FIPS provider bundled along with the image ? Or will this have to be added in / compiled in manually ?

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

No branches or pull requests

8 participants