Skip to content

Conversation

@kamalmahmudi
Copy link
Contributor

Change Summary

Let's say I have postgres server that only accepts ssl connection. But the cert on the server is self-signed. For this, I need to provide ca cert to nocodb. This is my command on packages/nocodb:

NC_DB="pg://ssldbhost:5400?u=theuser&p=thepass&d=nocodb&connection.ssl.caFilePath=/config/ca.crt" npm run run

I will get SELF_SIGNED_CERT_IN_CHAIN. This is because the promisify returns a Promise and the returned promise is converted by toString() first before it's resolved. And dbConfig.connection.ssl.ca now has [object Promise] as value.

Change type

  • feat: (new feature for the user, not a new feature for build script)
  • fix: (bug fix for the user, not a fix to a build script)
  • docs: (changes to the documentation)
  • style: (formatting, missing semi colons, etc; no production code change)
  • refactor: (refactoring production code, eg. renaming a variable)
  • test: (adding missing tests, refactoring tests; no production code change)
  • chore: (updating grunt tasks etc; no production code change)

Test/ Verification

Run the command from the Change Summary again. It should gives us App started successfully..

Additional information / screenshots (optional)

  • dbConfig.connection.ssl.caFilePath is an extra parameter for pg connection, and somehow here it must be removed or it won't work.
  • We can also use fs.readFileSync, but I don't use it, to keep the original approach.

@CLAassistant
Copy link

CLAassistant commented Mar 25, 2023

CLA assistant check
All committers have signed the CLA.

@kamalmahmudi kamalmahmudi force-pushed the fix/ssl-connection-config-with-file-path branch from 7072d26 to edb4773 Compare March 26, 2023 20:36
Copy link
Contributor

@wingkwong wingkwong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good. Can you also apply the same changes on /nocodb/packages/nocodb/src/lib/db/sql-client/lib/SqlClientFactory.ts?

@wingkwong wingkwong added this to the Next Release: 0.106.0 milestone Apr 4, 2023
@wingkwong wingkwong merged commit 98cf923 into nocodb:develop Apr 4, 2023
@kamalmahmudi kamalmahmudi deleted the fix/ssl-connection-config-with-file-path branch April 4, 2023 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants