Thanks to engineersmnky, I was able to solve my problem.
From this issue on github : https://github.com/brianmario/mysql2/issues/1379, I found that the new releases of the mariadb-connector-c (from late 2024, after the latest version of mysql2 as of now which is 0.5.6 from 28/02/2024), now forces by default the connection to a distant server with TLS, or at least verification of the distant server certificate. However, a variable was added named MARIADB_TLS_DISABLE_PEER_VERIFICATION, which is not initiated with mysql2 and serve to deactivate the tls certificate verification. (https://mariadb.com/kb/en/mariadb-connector-c-3-4-3-release-notes/)
So, a good way to solve this issue and skip the tls connection phase, is to instance this environment variable with :
ENV['MARIADB_TLS_DISABLE_PEER_VERIFICATION'] = '1'
At the start of you program.
This initiate the variable that make mariadb-connector-c to skip TLS verification.
Now, TLS connection is not activated and I can connect to my remote mysql server without needing ssl certificate or a TLS connection.