data-diff icon indicating copy to clipboard operation
data-diff copied to clipboard

Postgres Server Authenticate through verify-ca

Open terribilis opened this issue 1 year ago • 1 comments

I'm working on integrating data-diff, and I need to authenticate to a Postgres server using a certificate rather than a password. It would be great, if there is a way to authenticate this way. If it is already possible, I think it would be very helpful to include the command or template for the TOML file in order to do this. Thanks

terribilis avatar Aug 09 '22 17:08 terribilis

How would you do it using the psycopg2 library directly?

erezsh avatar Aug 10 '22 11:08 erezsh

According to this Stackoverflow you would set the sslmode to verify-ca and then just pass in the correct paths for the certificates. conn = psycopg2.connect(dbname='yourdb', user='dbuser', password='abcd1234', host='server', port='5432', sslmode='verify-ca', sslrootcert='path/to/cert')

terribilis avatar Aug 11 '22 20:08 terribilis

Just wanted to mention, I am able to connect with verify-ca using data-diff in python and passing in a dictionary with the correct values.

terribilis avatar Aug 19 '22 20:08 terribilis

Sorry, I missed your last comment!

Are you happy with your current solution? Or would you like to know how to specify those values in a URL?

I agree, it could help to add this info somewhere in the readme/docs.

erezsh avatar Aug 19 '22 23:08 erezsh

Close due to inactivity.

erezsh avatar Sep 20 '22 11:09 erezsh