Skip to content

Add client certificate (mTLS) support to Configuration #54

@binajmen

Description

@binajmen

Some HTTP APIs require mutual TLS (mTLS) for authentication, where the client presents a certificate and private key during the TLS handshake. This is the equivalent of curl's --cert and --key flags:

$ curl -X GET https://api.example.com/resource \
  --cert certificate.pem \
  --key private_key.pem

Currently, Configuration only exposes verify_tls, timeout, and follow_redirects. There is no way to pass a client certificate and key to the underlying Erlang ssl module.

One approach would be individual builder functions on Configuration, consistent with the existing style:

httpc.configure()
|> httpc.client_certificate(certfile: "certificate.pem", keyfile: "private_key.pem")
|> httpc.dispatch(request)

Would you consider this as a valid feature request?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions