Repository navigation
Fix caBundle being dropped when a Curl handle is moved - #66
Merged
connormanning merged 1 commit intoOct 30, 2026
Merged
Conversation
Curl's move constructor (from connormanning#60) moved m_caPath, m_caInfo and m_proxy but not m_caBundle (added in connormanning#61). Pool fills m_curls with emplace_back, so the handles moved on reallocation lose the bundle: - CURL_CA_BUNDLE, ARBITER_CA_BUNDLE and http.caBundle are ignored on those handles, and curl falls back to its default CA file - CURL_CA_INFO / http.caInfo are unaffected Tested against a local HTTPS S3 stub signed by a private CA, with the CA given only via CURL_CA_BUNDLE or ARBITER_CA_BUNDLE: 5046813 (before connormanning#60) fetches the object, master (3e5dde7) fails the TLS handshake, this commit fetches it.
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.
Discovered & worked-around during testing for #64.
I had built a static test binary but ran on a different distro on the test EC2 instance, so the CA file was in a different location than the static libcurl's built-in default. So I needed to declare the CA.
It worked using
CURL_CA_INFObut notCURL_CA_BUNDLE.Reproduced locally with an HTTPS S3 stub signed by a private CA. Results, with the CA given only by the listed variable:
50468133e5dde7f7152a9CURL_CA_INFO(control)CURL_CA_BUNDLEARBITER_CA_BUNDLEThe move constructor
Curl::Curl(Curl&& other)added in #60 doesn't movem_caBundle, the member added in #61 (they were open at the same time).The fix adds the move for the
m_caBundlemember in the move constructor.The move constructor runs because Pool builds its handles one at a time with
m_curls.emplace_back(...), and when the vector grows the handles already in it are moved and lose the setting.Acknowledgement: Claude Opus 5.5 spotted
CURL_CA_BUNDLEbeing ignored during the #64 EC2 testing, traced it to the move constructor, wrote this one-line change, and added the CA cases to the local test harness.