gleam-lang / gleam-lang/httpc

Add custom cacert support

Open
#36 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Gleam
Stars
175
Forks
31
PR merge metrics
No merged PRs in 30d

Description

While `httpc` does support TLS verification of remote server certificates, it can only do so against the client system's authorized CAs. However, it is currently not possible to provide a custom CA certificate instead of relying the the system's authorized CAs. Other HTTP clients usually do provide this option, like `curl` with `--cacert`.

The only workarounds currently are either to add the custom CA to the system's authorized CAs (which can be inconvenient or impossible in some cases), or to skip TLS verification (which is insecure).

[The `Configuration` type](https://github.com/gleam-lang/httpc/blob/16d90a1b80351b3d97e9737675b9fd34f490c187/src/gleam/httpc.gleam#L125C1-L139C1) currently only includes a `verify_tls: Bool` field. I think custom CA certificates could maybe be implemented with a `custom_ca_cert: Option(String)` field.

What do you think?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.