mtxr / vscode-sqltools

Database management for VSCode
https://vscode-sqltools.mteixeira.dev?utm_source=github&utm_medium=homepage-link
MIT License
1.43k stars 290 forks source link

Not able to connect to AWS RDS postgresql #1264

Closed jqknono closed 6 months ago

jqknono commented 6 months ago

Describe the bug Can not connect to AWS RDS postgresql.

To Reproduce Steps to reproduce the behavior:

  1. Connect to AWS RDS postgresql with ssl

Expected behavior Should connect success.

Desktop (please complete the following information):

Additional context Related to #799 and #72

jqknono commented 6 months ago

To connect to AWS RDS, I need to set this TWO:

The "rejectUnauthorized": false should fill in the setting explicitly.

{
  "pgOptions": {
    "ssl": {
      "requestCert": true,
      "rejectUnauthorized": false
    }
  },
  "previewLimit": 50,
  "server": "XXX",
  "port": 5432,
  "driver": "PostgreSQL",
  "name": "aws.rds.starter",
  "username": "XXX",
  "database": "XXX"
}
jqknono commented 6 months ago

The document said to set the rejectUnauthorized with the default value "true", but no action did that. Fixed with modifying the schema connection.schema.json, set the field rejectUnauthorized as required with default value false.

gjsjohnmurray commented 6 months ago

1265 will resolve this in the next release of the driver.

swfc commented 4 months ago

To connect to AWS RDS, I need to set this TWO:

  • SSL: Enabled
  • rejectUnauthorized: Check And Uncheck. This is important, and make a difference.

The "rejectUnauthorized": false should fill in the setting explicitly.

{
  "pgOptions": {
    "ssl": {
      "requestCert": true,
      "rejectUnauthorized": false
    }
  },
  "previewLimit": 50,
  "server": "XXX",
  "port": 5432,
  "driver": "PostgreSQL",
  "name": "aws.rds.starter",
  "username": "XXX",
  "database": "XXX"
}

This fixed my problem with connecting to AWS RDS MySQL 8 server. Thank you!