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

Support SSL connection options #44

Open
abeluck opened this issue Mar 27, 2018 · 2 comments
Open

Support SSL connection options #44

abeluck opened this issue Mar 27, 2018 · 2 comments

Comments

@abeluck
Copy link

abeluck commented Mar 27, 2018

Both postgresql and mysql support SSL connections and have various options that need to be supplied by the client. Presumably Oracle does too.

We would love to be able to connect our prosody instance to a remote database server over SSL.

@abeluck
Copy link
Author

abeluck commented Mar 27, 2018

Since each provider has its own ssl semantics, I wonder if the best approach is to abstract and provide some sort of common ssl opts interface. But then what about other reasonable provider-specific opts that users might want implemented?

Maybe instead a strategy would be to have a generic config hash that can be plumbed down so each driver can be their own special snowflake.

@abeluck
Copy link
Author

abeluck commented Mar 28, 2018

It turns out in the postgres case that you can actually connect with SSL certs by providing a conninfo string to the database parameter like:

// in lua
database = "sslmode=require host=10.34.0.3 dbname=actual_databae_name;

"If the dbName contains an = sign or has a valid connection URI prefix, it is taken as a conninfo string"
https://www.postgresql.org/docs/9.6/static/libpq-connect.html

Then in /var/lib/prosody/.postgresql/ you place your ca cert and client keypair.

There are tons of options/flags you can add to a conninfo string: https://www.postgresql.org/docs/9.6/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS

So maybe this is just a documentation issue?

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

No branches or pull requests

1 participant