Skip to content

Support per-backend CA bundles in the native curl backend - #3091

Merged
adamw merged 3 commits into
softwaremill:masterfrom
ahjohannessen:curl-ca-file
Dec 3, 2026
Merged

adamw merged 3 commits into
softwaremill:masterfrom
ahjohannessen:curl-ca-file

Conversation

@ahjohannessen

@ahjohannessen ahjohannessen commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Adds a caFile: Option[Path] = None parameter to CurlBackend, CurlTryBackend, CurlCatsBackend and CurlZioBackend (including layer and scoped), for services that use a private CA. The PEM file replaces libcurl's default CA bundle for that backend. The backend clears the compiled-in CA directory where supported, and keeps peer and hostname verification enabled. Some TLS implementations, including Apple's system libcurl, may still use the OS trust store.

The old apply(verbose) signatures stay as private[curl] overloads for binary compatibility.

Also fixes a curl handle leak: requests with attributes are rejected before a handle is allocated.

CurlCaFileTest runs against a local openssl s_server. It is canceled when openssl on PATH is not OpenSSL 1.1.1+.

Let callers choose a PEM bundle when creating a CurlBackend or
CurlTryBackend for a service that uses a private CA. The file replaces
libcurl's default bundle for that backend. Certificate and hostname
verification stay enabled.

Reject requests with attributes before allocating a curl handle. The
previous error path leaked the handle when attributes were present.

Reviewed-by: Claude <noreply@anthropic.com>
Co-authored-by: Codex <codex@openai.com>
@ahjohannessen

Copy link
Copy Markdown
Contributor Author

Two CI jobs failed because Maven Central returned HTTP 429 (Too Many Requests). Could a maintainer rerun them?

@adamw
adamw merged commit 2fd0286 into softwaremill:master Dec 3, 2026
40 of 44 checks passed
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