DEV Community

Discussion on: How to Setup PostgreSQL with SSL inside a Docker Container

Collapse
 
neilcamoore profile image
Neil Moore

There are a couple of typos, I think. The certificates generated are called postgresql.{key,crt} but the Dockerfile refers to them as server.{key,crt}

Collapse
 
danvixent profile image
Daniel Oluojomu

Thanks a lot Neil!, fixed.

Collapse
 
audstanley profile image
Richard Stanley • Edited
CMD [ "-c", "ssl=on" , "-c", "ssl_cert_file=/var/lib/postgresql/server.crt",
Enter fullscreen mode Exit fullscreen mode

needs to be:

CMD [ "-c", "ssl=on" , "-c", "ssl_cert_file=/var/lib/postgresql/postgresqldb.crt",
Enter fullscreen mode Exit fullscreen mode

and,

    "ssl_key_file=/var/lib/postgresql/server.key", "-c",\
Enter fullscreen mode Exit fullscreen mode

needs to be:

    "ssl_key_file=/var/lib/postgresql/postgresqldb.key", "-c",\
Enter fullscreen mode Exit fullscreen mode

thank you for putting this together - certstrap helped save a lot of time also - much appreciated. :-)

Thread Thread
 
danvixent profile image
Daniel Oluojomu • Edited

Actually its postgresdb., but thanks a lot Richard. I've fixed that also.

Almost a year i wrote this. Need to put out something on cryptography again!

Thread Thread
 
audstanley profile image
Richard Stanley

lol - my bad - it's so easy to mess up. :-)

Thread Thread
 
audstanley profile image
Richard Stanley

...i wrote it correctly in the Containerfile - so... i don't know what's wrong with me today.

Thread Thread
 
danvixent profile image
Daniel Oluojomu

Haha, i was asking myself the same thing after reading your comment.