-
Notifications
You must be signed in to change notification settings - Fork 38
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
SSL connection does not work properly #16
Comments
I think this could be an issue with environment variables. Currently, I'm trying to implement a solution and package this in a Dockerfile and pass in the .env variables. The connection string does not take .env as far as I can see... Your $PWD is therefore going to go in a $PWD |
@parsiazare I see some open issues regarding sslmode in the used pgx package - I will look into it |
I created a fork (I guess 21 days ago) where you can pass in a 'environment' parameter in the config.yaml. I initialized Regardless, super cool app that we are/will be running some actions through with our commits. Thanks! |
It is possible to expand env variables in the connection string (spf13/viper#119 (comment)) I could already confirm that it works and I added an integration test to test the ssl connection parameters. @sachasmart-weavik does this also include/fix your use case or do you need the possibility to split up the connection parameters into different variables like in your fork? |
Ooh that looks promising, yes that should work... My preference would be not to split up the variables into different parameters, instead something like would be better |
Expanding env variables is now available in version 0.4.0 @sachasmart-weavik The example from your last comment should work now - please let me know if does not :) |
I work with @parsiazare … and this is awesome response, thank you! |
I've been trying to get this to work with SSL and am running into this error from the docker logs:
LOG: could not accept SSL connection: sslv3 alert bad certificate
Here is my connection string that does not work:
mermerd -c postgresql://david:password@localhost:5433/david?sslmode=verify-full&sslcert=$PWD/packages/david-db/src/client.crt&sslkey=$PWD/packages/david-db/src/client.key&sslrootcert=$PWD/packages/david-db/src/ca.crt -s public --useAllTables -o docs/erd.mmd
Using the same certificates with docker works fine:
docker exec -i david-test psql -U david -d david sslmode=verify-full sslrootcert=$PWD/packages/david-db/src/ca.crt sslkey=$PWD/packages/david-db/src/client.key sslcert=$PWD/packages/david-db/src/client.crt
The certificates also work correctly with pgAdmin and knex migrations.
The text was updated successfully, but these errors were encountered: