su - postgres mkdir ~/openssl openssl req -new -x509 -days 365 -nodes -text -subj '/CN=postgres' -out ~/openssl/server.crt -keyout ~/openssl/server.key chmod 600 ~/openssl/server.key