Question
Can't connect via NodeJS - Error: self signed certificate in certificate chain
Here is my connection code :
this.connection = mysql.createConnection({
host: 'xxxx.db.ondigitalocean.com',
user: 'doadmin',
port: 25060,
password: 'xxxx',
dialect: 'mysql',
force: true,
ssl: {
cert: fs.readFileSync(__dirname + '/ca-certificate.crt'),
}
});
Here is the error im getting
(node:5676) UnhandledPromiseRejectionWarning: Error: self signed certificate in certificate chain
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×