Created
May 9, 2020 08:04
-
-
Save jarlah/548a922c1eb2c82dbe7e2475ba016ddb to your computer and use it in GitHub Desktop.
Play Scala and Slick 3: How to connect to postgresql database that requires certificate for connecting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slick.dbs.default.profile = "slick.jdbc.PostgresProfile$" | |
slick.dbs.default.db.driver = "org.postgresql.Driver" | |
slick.dbs.default.db.url = "jdbc:postgresql://localhost:5432/<db>" | |
slick.dbs.default.db.user = "<user>" | |
slick.dbs.default.db.password = "<password>" | |
slick.dbs.default.db.properties.ssl = "true" | |
slick.dbs.default.db.properties.sslmode = "verify-ca" | |
slick.dbs.default.db.properties.sslfactory = "org.postgresql.ssl.jdbc4.LibPQFactory" | |
slick.dbs.default.db.properties.sslpassword = "<pass>" // or comment out if no password on postgresql.pk8 | |
slick.dbs.default.db.properties.sslcert = "<path>/postgresql.crt" // the client certificate | |
slick.dbs.default.db.properties.sslrootcert = "<path>/root.crt" // the ... root .. certificate ;) | |
slick.dbs.default.db.properties.sslkey = "<path>/postgresql.pk8" // the private key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the private key, postgresql.key, must be converted to .pk8 format