0

I'm trying to use letsencrypt to generate certs in order to encrypt communication between a remote client and my postgresql database server. I'm not sure how to get started on setting this up. What kind of certs do I need for the client? What cert files should I store on the server? I've gone through this documentation as reference but it's still unclear as to which certificates go where? Thanks in advance!

Edit: Some clarification since this question was put on hold: I was unsure of what to expect when trying to use letsencrypt. I understand the basics of ssl/tls. But I needed some clarification about whether the certs generated on the server need corresponding certs on the client. The accepted answer has since pointed me in the right direction and the linked postgresql documentation has helped as well.

2

I've found this article to be quite useful. Assuming you know how PostgreSQL HBA generally works (i.e., how pg_hba.conf and postgresql.conf work), you do the following:

  1. start up certbot and have letsencrypt generate the cert where it
  2. typically does create a script to let letsencrypt copy renewed
  3. certs and keys to $PGDATA make sure postgresql.conf and
  4. pg_hba.conf are configured properly restart Postgres. done
  • That looks useful. What would my domain be in this case? I should've mentioned that the remote client communicates with postgresql through a script. – horsinaround Nov 12 at 19:52
  • Your domain is supposed to simply be your server's hostname, as would be seen by a client. If an external client (outside your LAN), then your external domain name. If an internal client (inside your LAN), depending on how your network is set up, your server's hostname should be sufficient. – richyen Nov 12 at 19:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.