Skip to content

Fix SSL CA certificate detection for extension downloads#640

Merged
adsharma merged 2 commits into
LadybugDB:mainfrom
mdbenito:fix/ssl-certs
Jul 2, 2026
Merged

Fix SSL CA certificate detection for extension downloads#640
adsharma merged 2 commits into
LadybugDB:mainfrom
mdbenito:fix/ssl-certs

Conversation

@mdbenito

@mdbenito mdbenito commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Extension downloads over HTTPS fail with SSL verification errors when a Ladybug wheel built on one Linux distro (e.g. RHEL) is run on another (e.g. Debian). The vendored httplib (v0.14.2) falls back to OpenSSL's compile-time default CA paths, which don't match the runtime system's CA bundle location.

This PR adds ExtensionUtils::getCaCertPath() which probes for a usable CA bundle in order: SSL_CERT_FILE/SSL_CERT_DIR env vars, then well-known distro paths (Debian, RHEL, openSUSE, Alpine, macOS Homebrew), then CApath directories. The result is wired into the extension download client via set_ca_cert_path(). If nothing is found, it returns std::nullopt and OpenSSL's defaults apply (preserving existing behavior).

Limitation

macOS Keychain loading is not supported by the vendored httplib v0.14.2 (that support was added in later upstream versions). On a clean macOS install without a Homebrew-provided CA bundle at /etc/ssl/cert.pem, the probe will find nothing and fall back to OpenSSL defaults, which may still fail. Probably the real fix for macOS is upgrading the vendored httplib.

@mdbenito

mdbenito commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@adsharma
adsharma merged commit e5c4c58 into LadybugDB:main Jul 2, 2026
7 of 8 checks passed
@mdbenito
mdbenito deleted the fix/ssl-certs branch July 2, 2026 17:51
adsharma pushed a commit to LadybugDB/bugscope that referenced this pull request Jul 14, 2026
0.18.1 fixes SSL CA certificate detection for extension downloads
(LadybugDB/ladybug#640). Caveat: SSL on macOS is not fully settled in
this release; the published 0.18.1 macOS Node addon still hardcodes
build-machine OpenSSL paths, addressed post-release by
LadybugDB/ladybug#682. That addon is a different artifact from the
liblbug C library linked here, so it does not gate this bump.

Point CI's liblbug artifact resolution at the matching ref; CI needs a
successful build-and-deploy run for v0.18.1 to exist.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants