How do I manage SSL credentials for multiple Postgres connections?
use the sslcert and sslkey paramterer in the connection string to indicate the files you want. 

https://www.postgresql.org/docs/10/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS

eg:

 con=psycopg2_connect(dsn='host=host1 user=yourname sslcert=host1.crt sskkey=host1.key')


probably something using string::format would be more practical.

.

If that seems too messy 

Using a service definition to store the parameters is another option
define the connection paramaters (like above) for each server in pg_services.conf (create that file) and use connection strings like

con=psycopg2_connect(dsn='service=host1')


https://www.postgresql.org/docs/10/static/libpq-pgservice.html

other clients (like psql) can also use the services thus defined, so this way will save you typing in the future.

but it seems redash is configured using environment variables  with the database as as a URL perhaps like this:

like this with a service definition

export REDASH_DATABASE_URL=postgres:///?service=database1


or 

like this explicitly:

export REDASH_DATABASE_URL="postgres://db_user@host.name.or.ip/db_name?sslcert=host1.crt&amp;sskkey=host1.key"


from a bries sfan of the docs redash seems to use postgres for db_user and db_name

so far as I know libpq does not use a different interface for database names, connection strings, and database urls, where one can be used any other form can be used instead, however the redash docs say to use a URL.

https://www.postgresql.org/docs/10/static/libpq-connect.html#LIBPQ-CONNSTRING