Doesn't work w/ server side self-signed SSL cert

peter20ji's profile image peter20ji posted 4 years ago in Creating a connection Permalink

MySQL 8.0.21 Docker version generates a self-signed SSL cert on startup.

CREATE USER 'm'@'%' IDENTIFIED BY 'H1%8w3';
GRANT EXECUTE, SELECT, SHOW VIEW, CREATE TEMPORARY TABLES, CREATE VIEW, INDEX, INSERT, UPDATE, LOCK TABLES  ON `db1`.* TO 'm'@'%';
FLUSH PRIVILEGES;
ALTER user 'm'@'%' REQUIRE ssl;

Then login w/ libmariadb.dll and use SSL w/o private key nor CA certs because I don't want a two-way authentication. Access denied.

Has successful connection w/ mysql-connector-8.0.20.jar in my project using jdbc:mysql://10.0.0.2:3306/db1?useSSL=true

There's no way to set trustServerCertificate=true or verifyServerCertificate=false as in JDBC URI. That solves problems in Java apps.

ansgar's profile image ansgar posted 4 years ago Permalink

The MariaDB docs lists a MYSQL_OPT_SSL_VERIFY_SERVER_CERT switch. Probably this is what you want to disable? According to another page this is disabled by default anyway.

Please login to leave a reply, or register at first.