-
Notifications
You must be signed in to change notification settings - Fork 4
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
Server-side resumption support #13
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpu
approved these changes
Apr 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I didn't have as much feedback through this branch. I think it was all fairly easy to understand 🚀
- `SSL_SESSION_get_id` - `SSL_SESSION_up_ref` - `SSL_SESSION_free` - `d2i_SSL_SESSION` - `i2d_SSL_SESSION` This will only be used for server-side sessions presently. (rustls client-side session types are not serializable.) nb. as of this commit, it is not possible to get an `SSL_SESSION` instance (except from deserialising one using `d2i_SSL_SESSION`, except -- where did the serialisation come from?!)
ctz
force-pushed
the
jbp-nginx-resumption
branch
from
April 30, 2024 14:00
a8f3eb2
to
d97d2dd
Compare
This provides: - `SSL_CTX_sess_set_cache_size` - `SSL_CTX_sess_get_cache_size` - `SSL_CTX_set_session_cache_mode` (all of these are routed through `SSL_CTX_ctrl`).
This is very bare-bones: it respects the size, but not the mode.
Just setter/getter for now.
This is needed later for it to be able to call `SSL_CTX_sess_remove_cb`.
Delete stub for `SSL_set_session_id_context`.
This has a `SSL_CTX`-scope object `ServerSessionStorage` that does the actual storage, plus a `SSL`-scope object `SingleServerCache` that delegates to that while tracking which `SSL_SESSION` was used for that single connection.
This only works for server SSLs currently.
This is observable from openssl behaviour (even though it is extremely unsound -- what happens if you `SSL_CTX_up_ref` inside the callback? Instant UAF!)
Every 255 cache operations, clear out any expired sessions.
This means unlimited size.
ctz
force-pushed
the
jbp-nginx-resumption
branch
from
April 30, 2024 14:16
d97d2dd
to
1b26307
Compare
cpu
approved these changes
Apr 30, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updates LGTM. Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR has as a goal getting the tests in the final commit to pass. Those extend the existing nginx integration test to start 4 different servers with varying resumption options (none, per-worker, per-server, and per-worker+server together) and see that resumption works in a basic sense.
Some of the earlier commits put into place infrastructure that isn't fully used until the last one (for example, the fields on
SslSession
).