8000 QUIC: adjusted OpenSSL 3.5 QUIC API feature test. by pluknet · Pull Request #749 · nginx/nginx · GitHub
[go: up one dir, main page]

Skip to content

QUIC: adjusted OpenSSL 3.5 QUIC API feature test. #749

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

Merged
merged 1 commit into from
Jul 3, 2025

Conversation

pluknet
Copy link
Contributor
@pluknet pluknet commented Jun 22, 2025

In OpenSSL 3.5.0, the "quic_transport_parameters" extension set internally by the QUIC API is cleared on the SSL context switch, which disables sending QUIC transport parameters if switching to a different server block on SNI. See the initial report in [1].

The test was narrowed down to the version number, in anticipation for the upcoming OpenSSL 3.5.1 release with the required bugfix [2]. Using OpenSSL 3.5.0 now falls back to the OpenSSL compat layer.

[1] #711
[2] openssl/openssl@45bd3c3798

@pluknet pluknet added this to the nginx-1.29.0 milestone Jun 22, 2025
@pluknet pluknet requested a review from arut June 22, 2025 17:28
@pluknet pluknet self-assigned this Jun 22, 2025
Copy link
Contributor
@arut arut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks ok. But since OpenSSL-3.5.1 has not been released yet, probably it's better to wait and make a separate nginx release then.

@pluknet
Copy link
Contributor Author
pluknet commented Jun 23, 2025

Ok, let's postpone this change until after the fixed version is released.
Interim, see #751

@pluknet pluknet removed this from the nginx-1.29.0 milestone Jun 23, 2025
@holow29
Copy link
holow29 commented Jul 1, 2025

OpenSSL 3.5.1 was just released today. Tag seems to have the fixed code in it, but I haven't tested the actual release to see if it is in proper working order.

@pluknet
Copy link
Contributor Author
pluknet commented Jul 1, 2025

@holow29
Good to know, thanks for the update.

We will likely follow with the next nginx-1.29.1 release soon, to accommodate.

@pluknet pluknet force-pushed the quic-ossl35-fix branch from 55289af to 2b3b002 Compare July 1, 2025 21:54
@pluknet
Copy link
Contributor Author
pluknet commented Jul 1, 2025

Rebased post cedb855.

arut
< 8000 a class="author Link--primary text-bold css-overflow-wrap-anywhere " show_full_name="false" data-hovercard-type="user" data-hovercard-url="/users/arut/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/arut">arut reviewed Jul 3, 2025
#define NGX_QUIC_BORINGSSL_API 1
#define NGX_QUIC_OPENSSL_COMPAT 1
#endif
#if (OPENSSL_VERSION_NUMBER >= 0x3050001fL)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem to work with openssl 3.5.1 release.

The last f of the version is not used since openssl/openssl@26b7cc0
The relevant part of the change:

- {- $config{prerelease}
-     ? << "_____"
- # define OPENSSL_VERSION_PRE_RELEASE "$config{prerelease}"
- _____
-     : << "_____"
- # undef OPENSSL_VERSION_PRE_RELEASE
- _____
-}
+ # define OPENSSL_VERSION_PRE_RELEASE "{- $config{prerelease} -}"

Current opensslv.h.in, _OPENSSL_VERSION_PRE_RELEASE is always 0x0L:

# define OPENSSL_VERSION_PRE_RELEASE "{- $config{prerelease} -}"    
             
...

# ifdef OPENSSL_VERSION_PRE_RELEASE                                              
#  define _OPENSSL_VERSION_PRE_RELEASE 0x0L                                      
# else                                                                           
#  define _OPENSSL_VERSION_PRE_RELEASE 0xfL                                      
# endif                                                                          
# define OPENSSL_VERSION_NUMBER          \                                       
    ( (OPENSSL_VERSION_MAJOR<<28)        \                                       
      |(OPENSSL_VERSION_MINOR<<20)       \                                       
      |(OPENSSL_VERSION_PATCH<<4)        \                                       
      |_OPENSSL_VERSION_PRE_RELEASE )                                            
    

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behaviour was changed in OpenSSL 3.0.0.
Actually, building with OpenSSL starting with this release version will make OPENSSL_VERSION_NUMBER to contain 30000000 (in hex).

This is actually documented, comparing the documentation in OpenSSL 1.1.1 versus OpenSSL 3.0+:

https://docs.openssl.org/1.1.1/man3/OPENSSL_VERSION_NUMBER/

OPENSSL_VERSION_NUMBER is a numeric release version identifier:

MNNFFPPS: major minor fix patch status

The status nibble has one of the values 0 for development, 1 to e for betas 1 to 14, and f for release.

https://docs.openssl.org/3.0/man3/OpenSSL_version/

OPENSSL_VERSION_NUMBER is a combination of the major, minor and patch version into a single integer 0xMNN00PP0L

Note the status nibble is always zero.

I will update the patch.

Note that there are existing checks for OpenSSL 3.0+ in the tree, they will need to be similarly fixed.

A bug with the "quic_transport_parameters" extension and SNI described
in cedb855 is now fixed in the OpenSSL 3.5.1 release, as requested
in openssl/openssl#27706.
@pluknet pluknet force-pushed the quic-ossl35-fix branch from 2b3b002 to 0aaead4 Compare July 3, 2025 15:55
@pluknet pluknet merged commit 0bb7489 into nginx:master Jul 3, 2025
1 check passed
@pluknet pluknet deleted the quic-ossl35-fix branch July 3, 2025 18:50
@Maryna-f5 Maryna-f5 added this to the nginx-1.29.1 milestone Jul 11, 2025
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

Successfully merging this pull request may close these issues.

4 participants
0