PostgreSQL connector: TLS certificate and hostname verification

:bullseye: What is your goal?

Hello Make Community,

We’re considering Make’s native PostgreSQL connector for a Neon database.

:thinking: What is the problem & what have you tried?

The documentation mentions Encrypt=Yes but doesn’t clarify TLS certificate verification.

Could someone from the Make team confirm:

  1. Does Encrypt=Yes validate the server certificate against trusted CAs?
  2. Does it verify the PostgreSQL server hostname?
  3. Is the behavior equivalent to sslmode=require, verify-ca, or verify-full?
  4. Is there an officially supported way to enable verify-full?

An official technical reference would be appreciated.

Thank you.

I am not affiliated with Make, so can’t vouch for its operation in the inside, but you can try it out yourself:

Create a temporary Postgres with ssl=on and self-signed certificate that’s accessible on the web and connect using Make with Encrypt=Yes.

When it connects, the connector is not using the certificate authority and is equivalent to sslmode=require. If it fails with a certificate error, then it’s testing the chain (verify-ca).
For the hostname check, use a valid certificate with a different name than the one that you are connecting with.

Don’t test on Neon. This will not tell much if you don’t connect to the right hostname as Neon will select the database on that host.

A support ticket is the path if you need it in writing for compliance. Until then, I’d create a new Neon role that had just the permissions that role requires. If your Neon plan includes IP Allow, restrict access to the published IP addresses of Make for your zone as well.

Running Neon in production here, a few practical notes the docs skip.

Neon enforces TLS on every connection and serves a cert from a public CA, so if the connector validates the chain at all it passes with nothing to upload. zarmeena’s test plan is the right way to answer your verify-ca vs require question empirically.

One thing that matters more than TLS for Make + Neon: use the pooled connection string, the one with -pooler in the host. Make’s connector opens a connection per run and closes it. On the direct endpoint that churn eats your connection limit fast. The pooler absorbs it.

Last one: create a dedicated role for Make with only the grants it needs. A webhook scenario that fires twice on a retry should never be able to drop a table.

Hello there,
Thanks for raising this important topic here!
I’ve discussed it internally, and here are the answers to your questions:

  1. Does Encrypt=Yes validate the server certificate against trusted CAs? Only partly. With the nested “Reject Unauthorized” option enabled, Node’s normal TLS chain validation applies. That option is not on by default. With the default (off), the certificate is not rejected.
  2. Does it verify the PostgreSQL server hostname? Yes, but only when Reject Unauthorized is true. The entered DNS hostname is sent as SNI. Node’s default hostname check against the certificate SAN/CN is used and is never modified. A mismatch fails the connection before authentication. With the default (false), a mismatch is not rejected.
  3. Is the behavior equivalent to sslmode=require, verify-ca or verify-full? There’s no direct comparison in the thread. Encrypt with Reject Unauthorized off behaves like require, since nothing is verified. Encrypt with Reject Unauthorized on checks both the chain and the hostname, which is the same as verify-full. That mapping is my inference from the answers, not something the thread states.
  4. Is there an officially supported way to enable verify-full? Effectively yes. Enable Encrypt, enable Reject Unauthorized, use the exact DNS hostname in Host, and put the provider’s CA bundle in the “Client CA” field if needed. The CA you supply replaces Node’s default trusted roots instead of being added to them.

Hope this answers all your questions, let me know if I can assist further!!