-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Hi,
I'm struggling to set up a connection to a Postgresql database that requires ssl.
I've configured the JDBC URL as: jdbc:postgresql://localhost:5432/datahub?sslmode=require
However, the app fails with the following error:
[info] com.github.mauricio.async.db.postgresql.exceptions.GenericDatabaseException: ErrorMessage(fields=Map(Line -> 481, File -> auth.c, SQLSTATE -> 28000, Routine -> ClientAuthentication, Message -> SSL connection is required. Please specify SSL options and retry., Severity -> FATAL)) [info] at com.github.mauricio.async.db.postgresql.PostgreSQLConnection.onError(PostgreSQLConnection.scala:175) [info] at com.github.mauricio.async.db.postgresql.codec.PostgreSQLConnectionHandler.channelRead0(PostgreSQLConnectionHandler.scala:206)
This is strange, because the implementation of ParseURL seems correct. I've created a small test class with this line of code:
val configuration = com.github.mauricio.async.db.postgresql.util.URLParser.parse("postgresql://localhost:5432/datahub?sslmode=require")
^ this will parse the ssl mode correctly.
I've run a debugger session in IntelliJ and put a breakpoint on com.github.mauricio.async.db.postgresql.util.URLParser in the assembleConfiguration.
But it seems this method is never invoked.
I put another breakpoint in PostgreSQLConnectionHandler, method initChannel (line 89) where I can view the parsed configuration. It turns out that database = Some(datahub?sslmode=require) and SSLConfiguration = (disable,None).
Can it be, that some other Parse method is being used? Can this be configured somewhere?
I spend quite some time debugging this, but I am unsure where to look further.
Versions:
val akkaVersion = "2.5.3"
"com.typesafe.akka" %% "akka-persistence" % akkaVersion,
"com.okumin" %% "akka-persistence-sql-async" % "0.4.0",
"com.github.mauricio" %% "postgresql-async" % "0.2.21",