Hello, I have setup a MySQL server with Letsencrypt certificates. I am wondering how to connect this server remotely from Nodejs (or any other) securely? When I connect with mysql command line client it says SSL is enabled. Below is output of mysql client ssl related variables:
mysql> SHOW VARIABLES LIKE 'SSL%';
+---------------+--------------------------+
| Variable_name | Value |
+---------------+--------------------------+
| ssl_ca | |
| ssl_capath | |
| ssl_cert | /etc/mysql/fullchain.pem |
| ssl_cipher | |
| ssl_crl | |
| ssl_crlpath | |
| ssl_key | /etc/mysql/privkey.pem |
+---------------+--------------------------+
Question is how do I connect to MySQL server from nodejs? In most of tutorials I've read the configuration file should look like below, but I don't have any of those files created by letsencrypt.
ssl : { ca : fs.readFileSync('./ca.pem') key: fs.readFileSync('./client-key.pem'), cert: fs.readFileSync('./client-cert.pem') }
I have been able to get enrypted connection between nodejs and mysql with following but I think it disables all the benefits of using letsencrypt:
ssl: { rejectUnauthorized: false, },