Getting "Error: self-signed certificate in certificate chain" #4181
Replies: 5 comments 4 replies
-
Which dB provider are you using?
…On Fri, 26 May, 2023, 00:50 Oliwer Helsén, ***@***.***> wrote:
Hi Guys,
I guess that I need to add my Certificate, but where? Is it under
Database_extra? If yes, how is the structure, can't see it in the type.
Thankful for the support 🙏
Best regards!
—
Reply to this email directly, view it on GitHub
<#4181>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXEQJHC6QMBIJUA6V5ANYVLXH6WJJANCNFSM6AAAAAAYPI3MRA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
This message (including any attachments) may contain confidential,
proprietary, privileged and/or private
information. The information is
intended to be for the use of the individual or entity designated above. If
you are not the intended recipient of this message, please notify the
sender immediately, and delete the
message and any attachments. Any
disclosure, reproduction, distribution or other use of this message or
any
attachments by an individual or entity other than the intended recipient is
prohibited.
|
Beta Was this translation helpful? Give feedback.
-
You need to specify I had the same issue and solved it with the following part const projectConfig = {
// ...
database_extra:
process.env.DATABASE_SSL !== 'true'
? undefined
: {
ssl: {
rejectUnauthorized: false,
},
},
}; Then just set You can also see the docs for general deployment |
Beta Was this translation helpful? Give feedback.
-
Is there any update? I'm getting the same kind of error, while trying to connect const database_extra = process.env.DATABASE_SSL ? {
ssl: {
rejectUnauthorized: true,
ca: process.env.DATABASE_SSL_CA,
}
}: {}
database_extra: database_extra,
Can someone help me? |
Beta Was this translation helpful? Give feedback.
-
The error "self-signed certificate in certificate chain" typically occurs when your client (in this case, your application or the tool you're using to connect to the Postgres instance) is rejecting the SSL certificate provided by the Postgres server. This worked for me:
|
Beta Was this translation helpful? Give feedback.
-
Hi, I also experienced the "self-signed certificate in certificate chain" error when trying to connect to a public RDS postgres instance, RDS forces connections to be encrypted, but it is also necessary to use a certificate that can be downloaded at least in the case of AWS from certificates database_extra:
process.env.POSTGRES_SSL === "ssl"
? {
ssl: {
rejectUnauthorized: true,
ca: fs.readFileSync(process.env.POSTGRES_CA).toString(),
},
}
: undefined, The configuration I use is the following, very similar to what @Saba-Shavidze had proposed, where Hope it helps 😄 |
Beta Was this translation helpful? Give feedback.
-
Hi Guys,
I guess that I need to add my Certificate, but where? Is it under Database_extra? If yes, how is the structure, can't see it in the type.
Thankful for the support 🙏
Best regards!
Beta Was this translation helpful? Give feedback.
All reactions