0

I have an application that I'm trying to connect to MariaDB with a JDBC driver over SSL. I have set the following parameters in the custom.cnf of my MariaDB server:

ssl_ca=/certs/ca-cert.pem
ssl_cert=/certs/server-cert.pem
ssl_key=/certs/server-key.pem
tls_version=TLSv1.2,TLSv1.3
require_secure_transport=on

It looks like everything is setup correctly on the MariaDB server because when I connect with MySQL workbench with SSL set to required it connects successfully. However, when attempting to connect with the JDBC driver it fails with the following error on the MariaDB server side:

[Warning] Aborted connection 79715 to db: 'unconnected' user: 'unauthenticated' host: 'mydbclient' (This connection closed normally without authentication)

I have the following set in my JDBC string:

{
        "datasources" : {
                 "mydatasource":{
                         "host":"dbserver",
                         "dbdriver":"MySQL",
                         "database":"mydatabase",
                         "dsn":"jdbc:mysql://{host}:{port}/{database}",
                         "custom":"useUnicode=true&characterEncoding=UTF-8&useLegacyDatetimeCode=true&autoReconnect=true&useSSL=true&verifyServerCertificate=false&serverTimezone=America/New_York&enabledTLSProtocols=TLSv1.2&requireSSL=true",
                         "port":"3306",
                         "class":"com.mysql.jdbc.Driver",
                         "username":"dbusername",
                         "password":"dbpassword",
                         "connectionLimit":"100",
                         "connectionTimeout":"1"
                 }
        }
}

If I remove the "require_secure_transport=on" from the custom.cnf and set "useSSL=false" in the JDBC string to it connects fine but of course the connection is not encrypted. I would appreciate some assistance on this.

1
  • Note, mariadb has its own Connector/J that has been more tested with MariaDB.
    – danblack
    Jul 17 at 12:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.