Search code examples
mysqlrundeck

public key ssl error when try to connect to mysql


In my laboratory I use rundeck to schedule the execution of my scripts, and rundeck uses mysql 8 as a database, but recently rundeck cannot start due to the following error: "java.sql.SQLTransientConnectionException: Could not connect to address=(host=localhost)(port=3306)(type=master) : RSA public key is not available client side (option serverRsaPublicKeyFile not set)"

However, I have already made the settings in both rundeck and mysql so as not to request SSL for the connection.

MySQL:

mysql> SHOW VARIABLES LIKE 'require_secure_transport';

+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| require_secure_transport | OFF   |
+--------------------------+-------+
1 row in set (0.00 sec)

mysql> SHOW VARIABLES LIKE 'ssl%';

+---------------------------+-------+
| Variable_name             | Value |
+---------------------------+-------+
| ssl_ca                    |       |
| ssl_capath                |       |
| ssl_cert                  |       |
| ssl_cipher                |       |
| ssl_crl                   |       |
| ssl_crlpath               |       |
| ssl_fips_mode             | OFF   |
| ssl_key                   |       |
| ssl_session_cache_mode    | ON    |
| ssl_session_cache_timeout | 300   |
+---------------------------+-------+
10 rows in set (0.00 sec)

mysql> SHOW VARIABLES LIKE '%ssl';

+---------------+----------+
| Variable_name | Value    |
+---------------+----------+
| have_openssl  | DISABLED |
| have_ssl      | DISABLED |
+---------------+----------+
2 rows in set (0.00 sec)

Key entries from the above:

| ssl_key       |          |
| have_openssl  | DISABLED |
| have_ssl      | DISABLED |

RUNDECK:

dataSource.url=jdbc:mysql://localhost/rundeck?autoReconnect=true&useSSL=false

Any ideas to fix it?


Solution

  • Add the following param in your datasource string: allowPublicKeyRetrieval=true

    Like this:

    dataSource.url=jdbc:mariadb://mysql/rundeck?autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true

    Additionally, if you're using a recent version of Rundeck, the MariaDB jdbc driver is the default driver for MySQL and MariaDB backends.

    Check this example.