postgresql-dart icon indicating copy to clipboard operation
postgresql-dart copied to clipboard

Feature Request: SSL connection with client side certificate

Open mbalmer opened this issue 4 years ago • 6 comments

The libpq C library allows the use of client side SSL certificates to secure a connection to the PostgreSQL server. As I saw no mention of client side certificates in the API documentation, I wonder if this feature could be added.

mbalmer avatar Nov 23 '21 10:11 mbalmer

@mbalmer: I'm happy to review PRs and merge them, if you are up to contribute this feature. Bonus if we could add an end2end test for it too.

isoos avatar Nov 23 '21 10:11 isoos

I only discovered this library a few days ago, so I first need to understand the code (and learn how create a library using flutter ;)

Am 23.11.2021 um 11:12 schrieb István Soós @.***>:

@mbalmer https://github.com/mbalmer: I'm happy to review PRs and merge them, if you are up to contribute this feature. Bonus if we could add an end2end test for it too.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/isoos/postgresql-dart/issues/18#issuecomment-976366012, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIAH7LS7DGNBBGSF5EYJLUNNSJTANCNFSM5ITC7YAA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mbalmer avatar Nov 23 '21 10:11 mbalmer

@mbalmer: the package is designed for server-side apps, and not for mobile apps. Just mentioning this, as you have mentioned flutter...

isoos avatar Nov 23 '21 10:11 isoos

My plan is to have a PostgreSQL client app running on a tablet in the same LAN as the PostgreSQL server. Are there any concerns when using this in a flutter app?

Adding a client side certificate should be straightforward, as a optional SecuritityContext object can be passed to the call to SecureSocket.connect() on line 315 of connection.dart

Am 23.11.2021 um 11:30 schrieb István Soós @.***>:

@mbalmer https://github.com/mbalmer: the package is designed for server-side apps, and not for mobile apps. Just mentioning this, as you have mentioned flutter...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/isoos/postgresql-dart/issues/18#issuecomment-976380365, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIAHYRUH77N63DI3RHLSLUNNUODANCNFSM5ITC7YAA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mbalmer avatar Nov 23 '21 10:11 mbalmer

I have no idea how the Flutter app will handle connections if/when there is context switch between apps. Maybe a connection pool with strict settings helps there (e.g. package:postgres_pool), you'll need to try it first :)

isoos avatar Nov 23 '21 10:11 isoos

I will give that a try. My work is in a proof of concept state only...

Am 23.11.2021 um 11:39 schrieb István Soós @.***>:

I have no idea how the Flutter app will handle connections if/when there is context switch between apps. Maybe a connection pool with strict settings helps there (e.g. package:postgres_pool), you'll need to try it first :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/isoos/postgresql-dart/issues/18#issuecomment-976386664, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIAH23EVZZHZXX2ZIBK33UNNVO5ANCNFSM5ITC7YAA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mbalmer avatar Nov 23 '21 11:11 mbalmer