question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Connection to SSL DB: Error: self signed certificate in certificate chain

See original GitHub issue

Describe the bug

I use a DigitalOcean Managed Postgres database for the deployment, but get the following error when starting the logto container:

Error while initializing app Error: self signed certificate in certificate chain
at TLSSocket.onConnectSecure (node:_tls_wrap:1535:34)
at TLSSocket.emit (node:events:513:28)
at TLSSocket._finishInit (node:_tls_wrap:949:8)
at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:730:12) {
code: 'SELF_SIGNED_CERT_IN_CHAIN'

Expected behavior

Logto should be able to connect to SSL only databases.

How to reproduce?

  1. Get a hosted DB at DigitalOcean
  2. Configure the Logto Docker Container like this

Alright tried

I tried to use the following env vars to circumvent the problem:

- NODE_TLS_REJECT_UNAUTHORIZED='0'
- PGSSLMODE=no-verify

Context

OS: Linux Docker: ghcr.io/logto-io/logto:1.0.0-beta.6

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
charIeszhaocommented, Oct 18, 2022

Thanks, @akoenig. I saw the discussion between you and Gao on Discord yesterday. This looks promising and we will document it on our docs site if that also works for @flobaader

1reaction
flobaadercommented, Sep 30, 2022

@charIeszhao Alright thank you, looking forward to your results!

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: Connection to SSL DB: Error: self signed certificate in ...
The hotfix would be to have an environment variable that allows to trust the SSL cert of the database. That env var has...
Read more >
Resolving SSL Self-Signed Certificate Errors
This is caused by git not trusting the certificate provided by your server. Workaround. One possible workaround is to temporary disable SSL ......
Read more >
self signed certificate error · Issue #2009 · brianc/node-postgres
We updated our packages today and afterwards started seeing a connection error from Sequelize ORM: "self signed certificate".
Read more >
SSL Error: SELF_SIGNED_CERT_IN_CHAIN' while using ...
The error SELF_SIGNED_CERT_IN_CHAIN means that you have self signed certificate in certificate chain which is basically not trusted by the system.
Read more >
Troubleshooting issues with self-signed certificate
General Guidelines in avoiding connection failure errors: When a client tries to connect to the Oracle NoSQL Database Proxy it fetches the SSL...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found