Skip to content

Instantly share code, notes, and snippets.

@jakobii
jakobii / certs.sh
Last active April 1, 2021 17:36 — forked from mrw34/postgres.sh
Enabling SSL for PostgreSQL in Docker
#!/bin/bash
set -e
sudo rm -f server.req privkey.pem server.key server.crt
# https://www.postgresql.org/docs/11/ssl-tcp.html
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem
openssl rsa -in privkey.pem -passin pass:abcd -out server.key
openssl req -x509 -in server.req -text -key server.key -out server.crt
chmod og-rwx server.key