Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

SSL for MySQL connections #246

Description

@ksilin

Using other tools, I can establish an SSL-secured connection to a MySql DB by appending the parameters to the connection URL:

jdbc:mysql://<IP>:<PORT>/<DB>?verifyServerCertificate=false&useSSL=true

However, I have not found a way to do this in postgres-async (over quill-async-mysql).

  val confMap = Map(
    "url"                    -> "jdbc:mysql://<IP>:<PORT>/<DB>?verifyServerCertificate=false&useSSL=true",
    "user"        -> ...,
    "password"    -> ...,
    "sslmode"     -> "prefer",
    "sslrootcert" -> ".../ca.pem"
  )
  val mapConfig = ConfigFactory.parseMap(confMap.asJava)
  lazy val ctx: MysqlAsyncContext[Literal.type] = new MysqlAsyncContext(Literal, mapConfig)

The two SSL-related props seem to be dropped from the URL. The two SslConfiguration params sslmode and sslrootcert do not seem to apply or at least are not translated to verifyServerCertificate=false&useSSL=true. I have tried all possible combinations of sslmode & sslrootcert.

expected behavior: SSL-secured connection will be established
actual behavior: In all combinations, I am getting connection refused from the DB.

https://github.com/mauricio/postgresql-async/blob/master/db-async-common/src/main/scala/com/github/mauricio/async/db/SSLConfiguration.scala

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions