denodrivers / denodrivers/postgres
Support for sslmode no-verify
- Dominant language
- TypeScript
- Stars
- 655
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
When connecting to a remote database that is not exposed to the internet using SSH tunnels, the self-signed CA will not match the servers certificate name as for the connecting client the server name would be "localhost".
**Describe the solution you'd like**
Since the server is trusted and we just need a secure connection from the client, please support `no-verify` as a valid option for the `sslmode` option.
Currently if we try using `no-verify` option the following error is thrown
```shell
ConnectionParamsError: Supplied DSN has invalid sslmode 'no-verify'
```
**Additional context**
This is especially painful when the servers are hosted on AWS RDS (Postgres) and there is a requirement for connecting to them using the postgres client.
The servers certificate will have the certificate issued for the fully qualified name and when connecting over SSH tunnel and using `localhost` as the host name we receive error
```shell
TLS connection failed with message: invalid peer certificate: NotValidForName
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the DSN sslmode validation that emits the invalid-option error, then trace how the TLS connection handles certificate-name verification. Confirm the accepted option is handled consistently, and verify that a tunneled PostgreSQL connection no longer rejects it while existing sslmode behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, typescript
- Domain
- databases, security
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100