Created
April 23, 2020 10:05
-
-
Save marciofmjr/6cea952a3fc853491b464786f7f74db3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 - Instalar postgres através do brew | |
2 - Executar os comandos para gerar o certificado | |
```bash | |
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 | |
openssl rsa -passin pass:x -in server.pass.key -out server.key | |
rm server.pass.key | |
openssl req -new -key server.key -out server.csr | |
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt | |
``` | |
3 - Mover os certificados para a pasta do postgre | |
```bash | |
mv server.crt /usr/local/var/postgres | |
mv server.key /usr/local/var/postgres | |
``` | |
4 - Habilitar SSL na config do postgres | |
```bash | |
sudo vi /usr/local/var/postgres/postgresql.conf | |
``` | |
linha 100 + ou - | |
```bash | |
ssl = on | |
ssl_cert_file = 'server.crt' | |
ssl_key_file = 'server.key' | |
``` | |
5 - Ajustar permissão da chave | |
```bash | |
chmod 0600 server.key | |
``` | |
6 - Reiniciar postgres |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment