Connecting to Postgres

I’m trying to connect to Postgres, and I’m getting the following error:

[error] Postgrex.Protocol (#PID<0.340.0>) disconnected: ** (DBConnection.ConnectionError) ssl recv (idle): closed

My config/dev.exs file is configured as follows:

# Configure your database
config :todo_demo, TodoDemo.Repo,
  show_sensitive_data_on_connection_error: true,
  url: "postgres://user:pass@host/database",
  ssl: true,
  ssl_opts: [
    verify: :verify_peer,
    cacertfile: "/opt/homebrew/etc/ca-certificates/cert.pem",
    server_name_indication: 'host',
    parameters: [
      tcp_keepalives_idle: 300,
      tcp_keepalives_interval: 60,
      tcp_keepalives_count: 5
    ]
  ],
  stacktrace: true,
  pool_size: 10

The odd thing about this is that mix ecto.migrate works and migrates my database, but both mix ecto.create and mix phx.server fail me the error above.

Any help would be appreciated.

I wonder if this should be '/opt/homebrew/etc/ca-certificates/cert.pem' → a chartist, not a binary, since I think :ssl_opts are passed straight through?

Ah, yes, I did come across, that. I did think I had ' quotes. Let me try again.

No, this didn’t help. It was server_name_indication that I originally had this issue on. Doing the same for cacertfile didn’t make a difference.