By aalurdratek
Hi,
We are trying to connect the MySQL managed database cluster from Node.js app, and DB configuration as follows,
export const databaseConfig: DatabaseConfig = {
username: 'doadmin',
password: 'xxxxxxxxx',
database: 'xxxxxxxxx',
host: 'xx-xx-xx-xxxx-xx-xxx-xxx-x.db.ondigitalocean.com',
port: 25060,
dialect: 'mysql',
logging: true,
force: true,
timezone: '+00:00',
pool: {
max: 100,
min: 0,
idle: 200000,
acquire: 1000000,
},
ssl: true,
dialectOptions: {
ssl: {
ssl: true,
cert: fs.readFileSync(process.env.INIT_CWD + '/server/config/' + 'glitra_mysql_ca-certificate.crt')
}
},
The .crt file is downloaded from DO database connection setting section, When we run the application we are getting “self signed certificate in certificate chain”.
Anybody tried connecting with from Nodejs to managed db and help us on this issue?
Thanks, -SK
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
Looking at the error message it does seem like the issue might be around how the SSL is handled.
In your code if you set SSL mode to false do you still see this issue or add NODE_TLS_REJECT_UNAUTHORIZED=‘0’ as an environment variable
Also as a reference the below URL has similar issue and workaround .
Hope that this helps. Regards, Priyanka
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.