microsoft / microsoft/vscode-pgsql

Need to support more advanced SSL parameters for connecting to remote hosts (ie. AWS)

Open
#159 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
No language data
Stars
395
Forks
33
Avg merge
1h 46m
Merged PRs (30d)
3

Description

I cannot get a connection to a remote AWS (Aurora RDS) Postgres DB.
The instance is configured with encryption, so it requires some SSL parameter massaging.

Locally I am able to connect to it and at least download the data (using ie. pg_dump) if I set these ENV variables before calling it:
PGSSLMODE=require PGSSLCERTMODE=disable PGCONNECT_TIMEOUT=10

Similarly, when running node code (using typeorm package, DataSourceOptions object), I have to set this parameter:
ssl: { rejectUnauthorized: false }

Can't seem to get a connection otherwise using this extension.
I tried setting the ssl parameter in the vscode-pgsql config to these other values, to no avail:
true, false, "require", "prefer", "allow", "disable", { rejectUnauthorized: false }, etc...

It tends to throw the error:
"no pg_hba.conf entry for host "<my-ip-address>", user "postgres", database "mydb", no encryption"
It does list the servers on the left vscode-pgsql panel, but won't list their contents (throws the error).

Maybe exposing the underlying PG* env vars would help in scenarios like this.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the vscode-pgsql configuration's ssl option is passed to the PostgreSQL connection, then compare it with the PGSSLMODE, PGSSLCERTMODE, and PGCONNECT_TIMEOUT settings described in the issue. Reproduce the failure against an encrypted Aurora RDS connection if available. Done means supported SSL settings allow the remote server's contents to load instead of producing the no-encryption error.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.