Skip to content

Don't set CURL_NATIVE_CA if a cert path is provided#337

Open
freundTech wants to merge 1 commit into
duckdb:mainfrom
freundTech:fix-manual-ca-file
Open

Don't set CURL_NATIVE_CA if a cert path is provided#337
freundTech wants to merge 1 commit into
duckdb:mainfrom
freundTech:fix-manual-ca-file

Conversation

@freundTech

Copy link
Copy Markdown

I'm working on exposing Apple SecTrust support in the curl vcpkg package (microsoft/vcpkg#52150, microsoft/vcpkg#52158) to make it possible to solve #282. Depending on what the vcpkg maintainers decide this will be either an optional feature for duckdb-httpfs to enable or just enabled by default.

Testing with this enabled surfaced a small bug in duckdb-httpfs: Settign SET ca_cert_file = 'certificate_file'; will still fall-back to the native CA store, if one is available, instead of erroring when the certificate can't be validated using the provided cert file, causing test/sql/httpfs/ca_cert_file.test to fail.

This commit fixes this behavior to prepare for adding SecTrust support and fixing #282 later.

Depending on the operating system if both a cert path is provided and
CURL_NATIVE_CA is set, curl might first check against the provided cert
path and fall back to the native ca if it can't verify the cert.
However, when a user provides a custom cert path they want duckdb to
only use that certificate store and not fall back to operating system
certificates.

This prevents `test/sql/httpfs/ca_cert_file.test` from breaking when
curl is built with Apple SecTrust support.

Related: duckdb#282
@freundTech

Copy link
Copy Markdown
Author

The VCPKG maintainers decided to merge the version that always enables the curl build option, because they expect most users to want that behavior by default.

This means that without this fix the duckdb-httpfs test suite will likely fail when built with the new vcpkg build manifest.

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 this pull request may close these issues.

1 participant