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

Investigate nginx 1.24.0 session resumption #30

Closed
cpu opened this issue Jun 23, 2024 · 2 comments · Fixed by #35
Closed

Investigate nginx 1.24.0 session resumption #30

cpu opened this issue Jun 23, 2024 · 2 comments · Fixed by #35
Assignees

Comments

@cpu
Copy link
Member

cpu commented Jun 23, 2024

Similar to #18, but for the server-side of the equation. We already have some support for traditional session resumption, but there is some API surface/behaviour related to session tickets not yet implemented.

In particular using Nginx 1.24.0 with the runner.rs nginx/curl resumption tests causes all requests to the server configurations that are supposed to return "r" from /ssl-was-reused to return "." instead.

On startup, nginx logs:

2024/06/11 14:24:46 [warn] 2922744#2922744: nginx was built with Session Tickets support, however, now it is linked dynamically to an OpenSSL library which has no tlsext support, therefore Session Tickets are not available

That in turn seems to be emitted in ngx_event_openssl.c when SSL_CTX_set_tlsext_ticket_key_cb fails. Both that function (deprecated) and the replacement SSL_CTX_set_tlsext_ticket_key_evp_cb are #define's that expand to calls to SSL_CTX_callback_ctrl with cmd == SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB.

One option to resolve the above is to stub SSL_CTX_set_tlsext_ticket_key_cb and not call the callback. This in combination with setting a ticketer on the Rustls ServerConfig should be enough to get session ticket resumption working with Nginx 1.24. I tried this briefly and found the aws-lc-rs ticketer was always failing to decrypt-in-place the session ticket provided by curl w/ a resumption connection. More investigation is required.

See also some discussion on #18 placed there when I hadn't realized that #18 was client-specific.

@cpu
Copy link
Member Author

cpu commented Jun 26, 2024

In particular using Nginx 1.24.0 with the runner.rs nginx/curl resumption tests causes all requests to the server configurations that are supposed to return "r" from /ssl-was-reused to return "." instead.

This wasn't totally correct, it turned out only port 8446 had the regression. The root cause was in fact related to session ticket support, but specifically an interplay between 1.23.2+ and the shared mode of ssl_session_cache. Quick-fix is to disable session tickets: #34

Remaining: figuring out why the rustls ticketer isn't working and how to best support session tickets/shared mode session cache w/ the compat .so.

@cpu
Copy link
Member Author

cpu commented Jun 26, 2024

I tried this briefly and found the aws-lc-rs ticketer was always failing to decrypt-in-place the session ticket provided by curl w/ a resumption connection. More investigation is required.

FWIW This was a stupid mistake on my part; I was initializing the ticketer per-connection and so of course the decryption key didn't match for the resumed connection. More progress in #35

@cpu cpu closed this as completed in #35 Jun 27, 2024
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 a pull request may close this issue.

1 participant