Hi, I’m trying to connect to a postgres database which has SSL required. I don’t know how to configure it, because I tried configuring DB_POSTGRESDB_SSL_CA with the certificate but it keeps telling me the following error:
There was an error initializing DB: “SSL connection is required. Please specify SSL options and retry.”
Using another languages/platforms I only need to put sslmode=require, but I don’t know how to do it here.
Did you configure the DB_POSTGRESDB_SSL_CERT env as well? The CA env is for the passing the Certificate Authority and the CERT env is for passing the certificate.
Perfect, So it will probably be the key you have found and the one that @harshil1712 has mentioned, It is a bit odd that there is no bool option for using SSL/TLS but looking at the code it will automatically use it if any of the SSL options are set.
@Jon I don’t think so. I don’t see it on the Azure config, my other applications are using sslmode=require to connect and the Azure tutorials only use the CA cert
@alakran that is strange, I have taken a look at the Azure documentation and they seem to only provide the CA cert for the CA they use so no cert file itself which is annoying.
In theory just having one of the options set should be enough to get it working, Annoyingly I don’t have an Azure instance to play with so we may need to wait for @harshil1712.
It should yes, that has been my experience with Jira Server. I haven’t spun a private n8n instance yet, but will soon and I would expect that’s part of it.
Ah ok, So there is a bit of a difference between Jira and n8n. n8n doesn’t use JDBC for the connection it uses a javascript library called TypeORM. Looking at the Db.ts file it enables the SSL option if any of the options are set.
Thanks Jon, I see now… I thought we were talking the Postgres Node, now I see I overlooked the post talking internal connection.
The URL trick may still work in my experience, regardless of it not being JDBC… I have used this with other tools like Navicat with success. (It would be ironic if that was a JS/Java app, I don’t know…)
I think the file should be read because it has full permissions and it’s shown when I list the directory before starting n8n.
This is the log shown before the container dies:
2021-10-05T13:30:23.804Z | info | Initializing n8n process {"file":"start.js"}
2021-10-05T13:30:23.810Z | info |
n8n now checks for new versions and security updates. You can turn this off using the environment variable N8N_VERSION_NOTIFICATIONS_ENABLED to "false"
For more information, please refer to https://docs.n8n.io/getting-started/installation/advanced/configuration.html
{"file":"start.js"}
UserSettings were generated and saved to: /root/.n8n/config
2021-10-05T13:30:24.938Z | debug | No codex available for: ElasticSecurity.node.js {"file":"LoadNodesAndCredentials.js","function":"addCodex"}
2021-10-05T13:30:28.340Z | debug | No codex available for: Misp.node.js {"file":"LoadNodesAndCredentials.js","function":"addCodex"}
2021-10-05T13:30:29.131Z | debug | No codex available for: Netlify.node.js {"file":"LoadNodesAndCredentials.js","function":"addCodex"}
2021-10-05T13:30:29.135Z | debug | No codex available for: NetlifyTrigger.node.js {"file":"LoadNodesAndCredentials.js","function":"addCodex"}
2021-10-05T13:30:29.185Z | debug | No codex available for: N8nTrainingCustomerDatastore.node.js {"file":"LoadNodesAndCredentials.js","function":"addCodex"}
2021-10-05T13:30:29.189Z | debug | No codex available for: N8nTrainingCustomerMessenger.node.js {"file":"LoadNodesAndCredentials.js","function":"addCodex"}
2021-10-05T13:30:32.905Z | error | There was an error initializing DB: "Connection terminated unexpectedly" {"file":"start.js"}
2021-10-05T13:30:32.907Z | info |
Stopping n8n... {"file":"start.js","function":"stopProcess"}