async def main():
await db.set_bind(f'postgres://admin:[email protected]:18629/prod?sslmode=verify&sslcert={ctx}')
Keeps throwing this error.
asyncpg.exceptions.InvalidAuthorizationSpecificationError: no pg_hba.conf entry for host " ", user "admin", database "prod", SSL off
From the error message, it looks like pg_hba.conf is not correctly configured. You may want to take a look at https://www.postgresql.org/docs/11/auth-pg-hba-conf.html
sslmode=verify&sslcert={ctx} - I don't think these two args are acceptable, ~let me check~.
The two arguments are from libpq, and inherited by psycopg2. GINO uses asyncpg, therefore this won't work. You'll probably need something like this:
ctx = ssl.SSLContext(...)
// create and configure your SSL context
await db.set_bind('postgres://admin:[email protected]:18629/prod', ssl=ctx)
See here for docs about ssl.
@fantix Should I submit a PR with some more examples of how to connect to the db including this one? Thanks again. Really great tool
Sure. Thanks!