···5959 req: request.Request(String),
6060 url: String,
6161) -> Result(#(Int, String), Error) {
6262- // TLS verification is on: gleam_httpc verifies `https` peers against the OS CA
6363- // store (public_key:cacerts_get), the webpki-roots equivalent. `http://`
6464- // targets are reached directly; the http-vs-https policy lives in did.gleam.
6565- let config = httpc.configure() |> httpc.verify_tls(True)
6262+ // Verify TLS for `https` peers against the OS CA store (public_key:cacerts_get).
6363+ // For `http` targets there is nothing to verify, and forcing verification would
6464+ // needlessly require the CA store to exist. The http-vs-https policy lives in
6565+ // did.gleam.
6666+ let config =
6767+ httpc.configure() |> httpc.verify_tls(string.starts_with(url, "https"))
6668 case httpc.dispatch(config, req) {
6769 Ok(resp) -> Ok(#(resp.status, resp.body))
6870 Error(e) -> Error(error.Transport(url, string.inspect(e)))