Closed galegor closed 2 years ago
I am not able to look at this in depth right now, but a quick search indicates this is more likely related to either the JRE version and configuration or machine configuration. I think that what the error is saying is that the protocol and/or cipher suites supported by your DB engine are not available (or acceptable) on the client side (the JDBC driver). Please take a look at this SO answer and see if it helps: https://stackoverflow.com/questions/38205947/sslhandshakeexception-no-appropriate-protocol. I'm sure there's a lot more useful information about this error out there, I only tried one search string and only skimmed the Google results.
Thanks for the quick response. I have created MySql DB on freesqldatabase and was able to connect without any issue on machine which was getting error on my test DB. Creating ticket with AWS, will update this one with an answer.
Issue resolved. What I found out is: connector/J does not enable connections with TLSv1.2 and higher by default due to compatibility issues, when connecting to servers that restrict connections to use those higher TLS versions, you might encounter com.mysql.cj.exceptions.CJCommunicationsException: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate). You need to enable connections with TLSv1.2 and higher versions using the enabledTLSProtocols connection property. See Section 6.9, “Connecting Securely Using SSL” for details here https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-rQeference-using-ssl.html My implementation of above in opentest included just adding enabledTLSProtocols and fixed issue.
jdbcUrl: "jdbc:mysql://myDB.us-east-1.rds.amazonaws.com/DB_name?enabledTLSProtocols=TLSv1.2",
Alternatively to connect to mySql DB without any TLS issues MariaDB also can be used (tested using mariadb-java-client-2.7.4.jar
).
Getting error when trying to connect to DB using java jdbc connector. Problem is most likely related to one of the dependencies. Noticed it when updated OpenTest Build: 1.2.4 Sep 14, 22:52 to current, downgrading back to 1.2.4 did not helped and getting same issue after that. Tested on multiple physical computers and Docker machines. Same test is working on old images and is not working if image is recreated based on same config.
Connector placed in user-jars: mysql-connector-java-8.0.18.jar Sample test code:
Error