-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Serialize curl_multi_cleanup calls for OpenSSL <1.1.0
#5321
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -676,6 +676,22 @@ CFURLSessionCurlVersion CFURLSessionCurlVersionInfo(void) { | |
| return v; | ||
| } | ||
|
|
||
| CFURLSessionSSLVersion CFURLSessionSSLVersionInfo(void) { | ||
| curl_version_info_data *info = curl_version_info(CURLVERSION_NOW); | ||
| CFURLSessionSSLVersion version = {0, 0, 0}; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related to my comment above, maybe we could add a boolean to the struct like |
||
|
|
||
| if (info && info->ssl_version) { | ||
| // Parse OpenSSL version string like "OpenSSL/1.0.2k-fips" or "OpenSSL/1.1.1" | ||
| const char *ssl_str = info->ssl_version; | ||
| if (strncmp(ssl_str, "OpenSSL/", 8) == 0) { | ||
| ssl_str += 8; // Skip "OpenSSL/" | ||
| sscanf(ssl_str, "%d.%d.%d", &version.major, &version.minor, &version.patch); | ||
| } | ||
| } | ||
|
|
||
| return version; | ||
| } | ||
|
|
||
|
|
||
| int const CFURLSessionWriteFuncPause = CURL_WRITEFUNC_PAUSE; | ||
| int const CFURLSessionReadFuncPause = CURL_READFUNC_PAUSE; | ||
|
|
||
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.
Since curl can be built with TLS libraries other than OpenSSL, and those libraries would return
{0, 0, 0}here, we'd be performing cleanup serialization that wouldn't have happened before/might not be needed. Would we want to add some way to check that SSL version parsing did succeed and is in fact OpenSSL before checking the version number?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.
Yes! I missed adding a comment that I was thinking "if the SSL library is not known, then serialise cleanup". But true, it makes sense to not be unnecessarily defensive in this case. So I'll refactor as needed.