Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass an SSL context to the postgresql backend? #84

Closed
Lawouach opened this issue Apr 17, 2019 · 5 comments · Fixed by #85
Closed

How to pass an SSL context to the postgresql backend? #84

Lawouach opened this issue Apr 17, 2019 · 5 comments · Fixed by #85

Comments

@Lawouach
Copy link

Hi,

It appears that databases only accepts a boolean to indicate if you want to connect over TLS to postgresql. But, the asyncpg driver supports to pass your own context, which is necessary when you have your own certs.

This make integrating in some environment a showstopper (our environment relies on TLS internally).

Was there a specific issue for not allowing passing a context?

Cheers,

  • Sylvain
@tomchristie
Copy link
Member

See #71

@Lawouach
Copy link
Author

This sounds like the good basis indeed.

@Lawouach
Copy link
Author

Hi Tom,

Thanks for being so swift. However, looking at the code, I'm not sure I see how to provide a SSL context myself. It seems it still expects a boolean, right?

Or am I reading that one wrong?

@tomchristie
Copy link
Member

You should be able to pass anything accepted by asyncpg.Connection() or asyncpg.create_pool.

I believe ssl accepts either an SSLContext or a boolean.

@Lawouach
Copy link
Author

Totally! I misread the code :)

Sorry. Thanks again for the speed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants