Skip to content

Can't connect to remote DB with SSL root cert #1554

@matewka

Description

@matewka

Tired of not having autocomplete in my SQL commands on CLI, I decided to give a go to the awesome pgcli.

The problem occurred immediately after I installed it and tried to connect to my remote database the same way I usually did with psql.

The command I used before:

# Works totally fine every time
psql -W -U postgres -p 5432 -h Some-host-name.mydomain.com -d "dbname=mydbname sslmode=verify-ca sslrootcert=relative/path/to/my/cert.pem"

After installing pgcli, the only thing I changed is the command (leaving all options unchanged):

# Doesn't work
pgcli -W -U postgres -p 5432 -h Some-host-name.mydomain.com -d "dbname=mydbname sslmode=verify-ca sslrootcert=relative/path/to/my/cert.pem"

Unfortunately, the latter command gives me this error:

connection is bad: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
	Is the server running locally and accepting connections on that socket?

My system is Mac Sequoia 15.6.
Postgres 15.4
pgcli 4.4.0 installed via brew install pgcli

What am I doing wrong?
Happy to provide more info if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions