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.