appcues / mojito

An easy-to-use Elixir HTTP client, built on the low-level Mint library.
https://hexdocs.pm/mojito/Mojito.html
MIT License
349 stars 34 forks source link

Allow configuring a default CA certificate file #45

Closed bfad closed 2 years ago

bfad commented 4 years ago

Instead of using the CAStore package, I would like to be able to specify the location of the certificate file that is managed by my OS. It would be great if I could configure Mojito to use that by default instead and make the CAStore package an optional dependency.

I would like to be able to have the following code in my config/config.exs file:

config :mojito, :cacertfile, "/etc/ssl/certs/ca-certificates.crt"

And then I would like all SSL connections to use that file unless the function call specifies something different in the transport_opts option.

I know this would be a breaking change that would require people currently using the package to either set the configuration or include CAStore as a dependency, so I thought I'd suggest it here before attempting to work on this myself.

gamache commented 4 years ago

Hi @bfad! Sorry for the late reply. I'm not keen on making this a breaking change, but I think making :transport_opts configurable in config.exs would be a good idea. I'm currently refactoring Mojito's config system, and I will make sure this gets in there.

ntenczar commented 2 years ago

Hi! This project is now deprecated:

We recommend that you use Finch which is also built on Mint. The creator of Finch has an excellent writeup here describing the problems with Mojito, and as a result we use Finch internally at Appcues now.