dsn2 = (
    """host=server2 user=testdb dbname=testdb sslcert=cert1.crt sslmode=verify-full sslkey=cert1.key sslrootcert=root1.crt"""
    )
conn2 = psycopg2.connect(dsn2)
Postgres - несколько SSL-соединений python