Disable certificate warnings for Ecto connections?

We’re using self signed certs for Postgres in local development and starting up our app spams us with these warnings:

[warning] Description: 'Authenticity is not established by certificate path validation'
     Reason: 'Option {verify, verify_peer} and cacertfile/cacerts is missing'

Is there a way to configure Ecto to not spit out those warnings? Thanks for the help!

1 Like

Sounds like a better solution would be to either fix this (not sure how) or just stop using SSL in local development. What do you think?

1 Like

You have to set your CA certificate in the :ssl_opts for the postgrex connection to get rid of the warnings (see Ecto.Adapters.Postgres — Ecto SQL v3.7.2).


Alternative: just mute the warning in development by passing ssl_opts: [log_level: :error] to your Repo config:

config :myapp, MyApp.Repo,
  ssl_opts: [log_level: :error]

I’ve found out about it here: Elixir, Ecto and Heroku Postgres: unverified SSL certificates