This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-13
Channels
- # aleph (3)
- # announcements (2)
- # babashka (15)
- # beginners (84)
- # biff (28)
- # calva (2)
- # cherry (1)
- # clj-kondo (24)
- # clojure (69)
- # clojure-austin (35)
- # clojure-brasil (7)
- # clojure-conj (2)
- # clojure-europe (83)
- # clojure-losangeles (1)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-portugal (5)
- # clojure-turkiye (2)
- # clojurescript (25)
- # css (4)
- # cursive (11)
- # data-science (26)
- # datahike (4)
- # datalevin (2)
- # emacs (19)
- # gratitude (1)
- # honeysql (1)
- # hyperfiddle (45)
- # introduce-yourself (5)
- # lsp (53)
- # malli (8)
- # mid-cities-meetup (1)
- # nrepl (19)
- # pathom (23)
- # practicalli (2)
- # proletarian (1)
- # rdf (2)
- # reagent (28)
- # releases (4)
- # shadow-cljs (11)
- # sql (13)
- # uncomplicate (6)
- # vim (7)
- # xtdb (3)
Hi everybody,
I try to use a HikariCP
threadpool with next.jdbc
. this works well with local mysql
container but fails when I try to reach AWS
instance. We use mysql
version 5.7. I tried this repl
code without success:
(let [config {:dbtype "mysql",
:password "***********",
:dataSourceProperties {:socketTimeout 30},
:username "*******",
:port 3306,
:dbname "dco",
:host
"*******."
:useSSL false}
reader (connection/->pool HikariDataSource config)]
(jdbc/execute!
reader
(sql/format {:select :column_name
:from :INFORMATION_SCHEMA.COLUMNS})))
Error returned is :
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 2 milliseconds ago. The last packet sent successfully to the server was 1 milliseconds ago.
SQLState: "08S01"
errorCode: 0
Execution error (SSLHandshakeException) at sun.security.ssl.HandshakeContext/<init> (HandshakeContext.java:170).
No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
I try to use play with enabledTLSProtocols
or tlsVersions
still without successHard to say, but that error sounds like AWS requires SSL and you have it turned off.
It works we specify the jdbc-url
in the db-spec
. It works also without threadpool.
What is the value of :jdbc-url
that works? Perhaps you haven't correctly mapped it to the db-spec hash map?
Oh, right, HikariCP doesn't have a useSSL
option -- that's why the hash map approach doesn't work.
So, yeah, you'll have to use the JDBC URL approach with HikariCP.
You could use next.jdbc.connection/jdbc-url
to construct (most of) the URL (without username/password) I think -- that will save you string-bashing.
BTW, did you try putting :useSSL false
into the :dataSourceProperties
hash map? I'm not sure whether that would work but it's worth trying...
OK, thanks. I'll try to improve the docs in this area: https://github.com/seancorfield/next-jdbc/issues/247