Repository navigation
ssl: dedup ssl_fsslctx - #22876
Closed
icing wants to merge 1 commit into
Closed
ssl: dedup ssl_fsslctx#22876icing wants to merge 1 commit into
icing wants to merge 1 commit into
Conversation
The members fsslctx(p) in `struct ssl_config_data` were only set on `data->set.ssl` and never on `data->set.proxy_ssl`, yet were used from the first one in all TLS filters that support it. Move the callback and its userdata outside the config struct, since we need it only once.
There was a problem hiding this comment.
🟢 Approval recommended
The refactor is narrowly scoped to internal storage/access of the SSL ctx callback and all in-repo references to the old fields appear consistently updated.
Pull request overview
This PR centralizes the CURLOPT_SSL_CTX_FUNCTION callback and its userdata so they’re stored only once on the easy handle, matching how the TLS backends actually use the callback (previously it lived inside set.ssl config but was effectively ignored for set.proxy_ssl).
Changes:
- Move
fsslctx/fsslctxpout ofstruct ssl_config_dataand intostruct UserDefinedasssl_fsslctx/ssl_fsslctxp. - Update OpenSSL, wolfSSL, and mbedTLS backends to use the deduplicated
data->set.ssl_fsslctx(p)fields. - Update DoH option propagation and
setopthandling to set/read the new fields.
File summaries
| File | Description |
|---|---|
| lib/vtls/wolfssl.c | Switch SSL ctx callback invocation to data->set.ssl_fsslctx(p). |
| lib/vtls/vtls_config.h | Remove SSL ctx callback members from struct ssl_config_data. |
| lib/vtls/openssl.c | Switch SSL_CTX callback invocation to data->set.ssl_fsslctx(p). |
| lib/vtls/mbedtls.c | Switch SSL config callback invocation to data->set.ssl_fsslctx(p). |
| lib/vdns/doh.c | Propagate SSL ctx callback + userdata using the new data->set.ssl_fsslctx(p) fields. |
| lib/urldata.h | Add ssl_fsslctx / ssl_fsslctxp to struct UserDefined. |
| lib/setopt.c | Store CURLOPT_SSL_CTX_FUNCTION / CURLOPT_SSL_CTX_DATA into the new fields. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| time_t timevalue; /* what time to compare with */ | ||
| struct ssl_config_data ssl; /* user defined SSL stuff */ | ||
| curl_ssl_ctx_callback ssl_fsslctx; /* function to initialize SSL ctx */ | ||
| void *ssl_fsslctxp; /* parameter for call back */ |
This file contains hidden or 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
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.
The members fsslctx(p) in
struct ssl_config_datawere only set ondata->set.ssland never ondata->set.proxy_ssl, yet were used from the first one in all TLS filters that support it.Move the callback and its userdata outside the config struct, since we need it only once.