Skip to content

Cannot pass SSL context to asyncpg from create_async_engine in SQLAlchemy 1.4 #5975

Answered by zzzeek
acnebs asked this question in Usage Questions
Discussion options

You must be logged in to vote

hi -

have you looked at connect_args ? this works the same way with the async engine:

my_ssl_ctx = ssl.create_default_context(cafile=PATH_TO_CA_FILE)
my_ssl_ctx.verify_mode = ssl.CERT_REQUIRED

async_engine = create_async_engine(POSTGRES_URL, connect_args={"ssl": my_ssl_context})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@acnebs
Comment options

Answer selected by CaselIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #5973 on February 24, 2021 17:19.