Using psql to connect to PostgreSQL in SSL mode

后端 未结 7 1446
攒了一身酷
攒了一身酷 2021-01-30 07:50

I am trying to configure ssl certificate for PostgreSQL server. I have created a certificate file (server.crt) and key (server.key) in data directory and update the parameter SS

7条回答
  •  抹茶落季
    2021-01-30 08:57

    psql --set=sslmode=require -h localhost -p 2345 -U thirunas \
    -d postgres -f test_schema.ddl
    

    Another Example for securely connecting to Azure's managed Postgres database:

    psql --file=product_data.sql --host=hostname.postgres.database.azure.com --port=5432 \
    --username=postgres@postgres-esprit --dbname=product_data \
    --set=sslmode=verify-full --set=sslrootcert=/opt/ssl/BaltimoreCyberTrustRoot.crt.pem
    

提交回复
热议问题