question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom CA certifcate in pgcli

See original GitHub issue

Description

Unable to find a config to supply custom CA certificate in pgcli. The cli parameter and the config file in AppData/Local/dbcli/pgcli/config neither of them seem to have a config to supply a custom ca file. Please help me figure out the config.

Your environment

  • Please provide your OS and version information. Windows 10

  • Please provide your CLI version. pgcli 3.0.0

  • What is the output of pip freeze command.

$ pip freeze
cli-helpers==2.1.0
click==7.1.2
configobj==5.0.6
humanize==2.5.0
pgcli==3.0.0
pgspecial==1.11.10
prompt-toolkit==3.0.5
psycopg2==2.8.5
Pygments==2.6.1
six==1.15.0
sqlparse==0.3.1
tabulate==0.8.7
terminaltables==3.1.0
wcwidth==0.2.5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
wchaocommented, Aug 19, 2020

Set the environment variable PGSSLROOTCERT, like so: PGSSLROOTCERT=/etc/ssl/certs/ca-bundle.trust.crt

You should be able to set use all of the PG environment variables. For instance, I use the following successfully: PGHOST PGDATABASE PGSSLMODE PGSSLROOTCERT PGSSLCERT PGSSLKEY

0reactions
laixintaocommented, Oct 13, 2020

Yes, please! I didn’t get a chance to check it. But will do it later. It is worth to be updated in readme. Custom CA is a typical use case for many projects.

Good idea! updated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connect to a PostgreSQL cluster with a custom CA Cert using ...
Sometimes we want to connect to a PostgreSQL database through SSL/TLS, but the database's CA Certificate aren't trusted by the computer.
Read more >
Using psql to connect to PostgreSQL in SSL mode
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...
Read more >
Custom CA certificates in Postgres Operator UI #1979 - GitHub
The backup from a Postgres cluster works fine thanks to the environment variable WALG_S3_CA_CERT_FILE , but I don't find any way to set...
Read more >
Making CA certificates available to Linux command-line tools
How to use the ca-certificates package to manage Certificate Authority certificates for command-line utilities.
Read more >
Updating applications to use new SSL/TLS certificates
Note. A client application that's configured to verify the server certificate before SSL/TLS connection must have a valid CA certificate in the client's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found