Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds DATABASE_SSL_KEY_BASE64 for pg connection #1613

Merged

Conversation

Jaredude
Copy link
Contributor

@Jaredude Jaredude commented Jan 25, 2024

DATABASE_SSL_KEY_BASE64 takes priority over DATABASE_SSL env var

If neither are provided, no ssl value will be used. This allows for the usage of PGSSLMODE

for example, using either of these two will establish a secure connection to the Postgres server
DATABASE_SSL=true
PGSSLMODE=verify-full

Using the following will override the above and allow you to pass your self-signed certificate to create a secure connection
DATABASE_SSL_KEY_BASE64=

Using neither of the flags allows using the unsafe/not recommended PGSSLMODE=no-verify

Addresses issue #1598

DATABASE_SSL_KEY_BASE64 takes priority over DATABASE_SSL env var

If neither are provided, no ssl value will be used.
This allows for the usage of PGSSLMODE
@HenryHengZJ HenryHengZJ linked an issue Jan 25, 2024 that may be closed by this pull request
@HenryHengZJ
Copy link
Contributor

awesome this looks good! thanks man @Jaredude !

@dkindlund
Copy link
Contributor

Looking forward to using this new feature, once the PR is merged! 👍 Thanks again, @Jaredude!

@HenryHengZJ HenryHengZJ merged commit f460b76 into FlowiseAI:main Jan 29, 2024
2 checks passed
@niztal niztal mentioned this pull request Jan 29, 2024
@inno-elon
Copy link

how do you obtain the Postgres SSL certificate encoded in base64? I can't get SSL to work with Postgres

@dkindlund
Copy link
Contributor

how do you obtain the Postgres SSL certificate encoded in base64? I can't get SSL to work with Postgres

Hey @inno-elon , you can use a tool like openssl to extract the X.509 SSL/TLS certificate from your Postgres server. The format is this:

openssl s_client -showcerts <DATABASE_IP>:5432

In that initial output, you should see base64 text returned from the server wrapped in a -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- block. You want to copy that entire block of text (including the BEGIN/END lines) and set that as your DATABASE_SSL_KEY_BASE64 value, accordingly.

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.

[BUG] Unable to connect to PostgreSQL with self-signed SSL
4 participants