-
Notifications
You must be signed in to change notification settings - Fork 2
Fix cURL CA #7
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
Fix cURL CA #7
Conversation
hatamiarash7
commented
May 18, 2025
- Bump DuckDB to v1.2.2
- Use a global handler for cURL
- Automatically find a suitable path for SSL CA ( Possible Fix for [BUG] Error extracting domain: Failed to download public suffix list. #6 )
- Improve docs
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.
Pull Request Overview
This PR fixes issues related to cURL CA certificate configuration, updates the version information, and bumps dependency versions, along with minor documentation improvements.
- Introduces a global cURL handler with automatic CA certificate path detection.
- Updates version strings in both the extension function and documentation.
- Bumps DuckDB and CI tools versions to support the changes.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/utils/utils.hpp | Added cURL header include and declaration of a global GetCurlHandler function. |
src/utils/utils.cpp | Implements GetCurlHandler with CA certificate autodetection and updated logging. |
src/functions/get_version.cpp | Updates the extension version string to v1.4.0. |
src/functions/get_tranco.cpp | Replaces redundant CURL initialization with GetCurlHandler. |
extension-ci-tools, duckdb | Bumps subproject commit hashes for dependencies. |
README.md | Updates version information in the documentation. |
.github/workflows/MainDistributionPipeline.yml | Updates workflow configuration to use updated versions. |
Comments suppressed due to low confidence (1)
src/utils/utils.cpp:15
- [nitpick] Consider renaming GetCurlHandler to CreateCurlHandler to clarify that the function creates and configures a new CURL handle.
CURL *GetCurlHandler ()
if (!ca_info) | ||
{ | ||
// Check for common CA certificate bundle locations on Linux | ||
for (const auto *path : { |
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.
[nitpick] Using fopen to check for file existence could be replaced with std::ifstream or std::filesystem for better portability and RAII compliance.
Copilot uses AI. Check for mistakes.
[skip ci]
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.
Pull Request Overview
This PR centralizes cURL initialization with SSL CA discovery, bumps DuckDB and CI tool versions, and updates documentation to reflect new extension version.
- Introduces
GetCurlHandler
to handle global cURL setup and locate SSL CA bundles. - Refactors download functions in
utils.cpp
and removes redundantcurl_easy_init
calls. - Updates extension version (v1.4.0), submodules to DuckDB v1.2.2, CI workflow, and README warnings.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/utils/utils.hpp | Added <curl/curl.h> include and GetCurlHandler declaration. |
src/utils/utils.cpp | Implemented file_exists , GetCurlHandler , and updated downloads. |
src/functions/get_version.cpp | Bumped extension version from v1.1.0 to v1.4.0. |
src/functions/get_tranco.cpp | Refactored to use GetCurlHandler instead of manual init. |
extension-ci-tools | Updated submodule pointer to v1.2.2. |
duckdb | Updated submodule pointer to v1.2.2. |
README.md | Added a Markdown warning admonition and updated version to v1.4.0. |
.github/workflows/MainDistributionPipeline.yml | Bumped DuckDB and CI tool versions to v1.2.2. |
Comments suppressed due to low confidence (3)
src/utils/utils.cpp:10
- This file uses std::getenv, std::ofstream, and std::runtime_error but doesn't include , , or . Consider adding these headers explicitly to avoid relying on transitive includes.
#include <sstream>
src/functions/get_tranco.cpp:16
- [nitpick] Consider changing the parameter from 'char *date' to 'const std::string &date' or 'const char *' to reflect that the function does not modify the input and improve API safety.
std::string GetTrancoDownloadCode (char *date)
README.md:374
- The arrow-based warning block ('-> [!WARNING]') appears to be a leftover or formatting mistake. Remove this duplicate and keep only the standard Markdown admonition.
-> [!WARNING]
[skip ci]
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.
Pull Request Overview
This PR aims to fix the management of cURL CA certificates by introducing a global cURL handler while also updating dependency versions and documentation.
- Introduces a new global cURL handler function (CreateCurlHandler) with logic to automatically determine a suitable CA certificate path.
- Bumps dependency versions in submodules and updates version strings in the extension (with changes in get_version.cpp, README.md, and CI workflow).
- Improves documentation by marking experimental functions.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/utils/utils.hpp | Added an include for curl header and declared the new global cURL handler prototype. |
src/utils/utils.cpp | Implemented the global cURL handler with CA certificate file path resolution logic. |
src/functions/get_version.cpp | Updated the extension version string from v1.1.0 to v1.4.0. |
src/functions/get_tranco.cpp | Replaced local cURL initialization with the new global handler for consistency. |
extension-ci-tools | Updated submodule commit to point to the new version. |
duckdb | Updated submodule commit to the specified DuckDB version bump. |
README.md | Updated the version table and added an experimental function warning for ipcalc. |
.github/workflows/MainDistributionPipeline.yml | Bumped version numbers for DuckDB and CI tools to support the new dependency versions. |
@@ -43,7 +43,7 @@ namespace duckdb | |||
|
|||
output.SetCardinality (1); | |||
// Set version | |||
output.data[0].SetValue (0, "v1.1.0"); | |||
output.data[0].SetValue (0, "v1.4.0"); |
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 version string is updated to v1.4.0, while the PR description and workflow indicate a bump to DuckDB v1.2.2. Please ensure that version numbers are consistent across the project.
output.data[0].SetValue (0, "v1.4.0"); | |
output.data[0].SetValue (0, "v1.2.2"); |
Copilot uses AI. Check for mistakes.
@@ -382,7 +382,7 @@ D select * from netquack_version(); | |||
│ version │ | |||
│ varchar │ | |||
├─────────┤ | |||
│ v1.2.0 │ | |||
│ v1.4.0 │ |
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 README now displays version v1.4.0, which conflicts with the intended DuckDB bump mentioned in the PR description and CI pipeline (v1.2.2). Consider reconciling these version numbers for clarity.
│ v1.4.0 │ | |
│ v1.2.2 │ |
Copilot uses AI. Check for mistakes.