Я пытаюсь настроить SSL-шифрование с помощью Slick и HikariCP. Вот конф:
mysqldb = {
dataSourceClass = "com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
initializationFailFast = false
properties {
user = "ssl_user"
password = "root"
databaseName = "ssl_db"
serverName = "localhost"
useUnicode = true
characterEncoding = UTF-8
useSSL="true"
javax.net.ssl.trustStore="/home/ec2-user/rds-combined-ca-bundle.pem"
javax.net.ssl.trustStorePassword=""
}
connectionTimeout = 10000
numThreads = 10
maxConnections = 10
minConnections = 4
queueSize =10000
}
Код для создания соединения:
import slick.jdbc.MySQLProfile.api._
val connectionPool = Database.forConfig(s"mysqldb")
val session = connectionPool.createSession()
Но, это ошибка:
Exception in thread "main" java.lang.RuntimeException: Property javax does not exist on target class com.mysql.jdbc.jdbc2.optional.MysqlDataSource
at com.zaxxer.hikari.util.PropertyElf.setProperty(PropertyElf.java:131)
at com.zaxxer.hikari.util.PropertyElf.lambda$setTargetFromProperties$0(PropertyElf.java:57)
at java.util.Hashtable.forEach(Hashtable.java:879)
at com.zaxxer.hikari.util.PropertyElf.setTargetFromProperties(PropertyElf.java:52)
at com.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:333)
at com.zaxxer.hikari.pool.PoolBase.<init>(PoolBase.java:109)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:108)
at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)
at slick.jdbc.hikaricp.HikariCPJdbcDataSource$.forConfig(HikariCPJdbcDataSource.scala:92)
at slick.jdbc.hikaricp.HikariCPJdbcDataSource$.forConfig(HikariCPJdbcDataSource.scala:21)
at slick.jdbc.JdbcDataSource$.forConfig(JdbcDataSource.scala:47)
at slick.jdbc.JdbcBackend$DatabaseFactoryDef.forConfig(JdbcBackend.scala:341)
at slick.jdbc.JdbcBackend$DatabaseFactoryDef.forConfig$(JdbcBackend.scala:337)
at slick.jdbc.JdbcBackend$$anon$1.forConfig(JdbcBackend.scala:32)
at com.techmonad.SSLConnection$.delayedEndpoint$com$techmonad$SSLConnection$1(SSLConnection.scala:7)
at com.techmonad.SSLConnection$delayedInit$body.apply(SSLConnection.scala:3)
at scala.Function0.apply$mcV$sp(Function0.scala:39)
at scala.Function0.apply$mcV$sp$(Function0.scala:39)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
at scala.App.$anonfun$main$1(App.scala:73)
at scala.App.$anonfun$main$1$adapted(App.scala:73)
at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:553)
at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:551)
at scala.collection.AbstractIterable.foreach(Iterable.scala:921)
at scala.App.main(App.scala:73)
at scala.App.main$(App.scala:71)
Любая помощь будет оценена.