Skip to content

Commit 5249d4d

Browse files
authored
"Error: self-signed certificate in certificate chain", the certificate used in the document has been changed.
I suggest changing the SSL certificate listed in the documentation from ``BaltimoreCyberTrustRoot.crt.pem`` to ``DigiCertGlobalRootCA.crt``. I have tried to connect to Azure Database for MySQL from Node.js according to the following documentation. [https://learn.microsoft.com/ja-jp/azure/mysql/single-server/connect-nodejs](connect-nodejs) However, I got an error ```Error: self-signed certificate in certificate chain``` and could not connect to the database. I haven't been able to track down the exact cause, but the SSL certificate I downloaded from the Azure Portal "Azure Database for MySQL flexible server -> Networking -> Download SSL Certificate" was ```DigiCertGlobalRootCA.crt```, so I believe this is the correct one.
1 parent bf9faf6 commit 5249d4d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

articles/mysql/single-server/connect-nodejs.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ Get the connection information needed to connect to the Azure Database for MySQL
101101

102102
1. Paste the JavaScript code into new text files, and then save it into a project folder with file extension .js (such as C:\nodejsmysql\createtable.js or /home/username/nodejsmysql/createtable.js).
103103
1. Replace `host`, `user`, `password` and `database` config options in the code with the values that you specified when you created the server and database.
104-
1. **Obtain SSL certificate**: Download the certificate needed to communicate over SSL with your Azure Database for MySQL server from [https://www.digicert.com/CACerts/BaltimoreCyberTrustRoot.crt.pem](https://www.digicert.com/CACerts/BaltimoreCyberTrustRoot.crt.pem) and save the certificate file to your local drive.
104+
1. **Obtain SSL certificate**: Download the certificate needed to communicate over SSL with your Azure Database for MySQL server from [https://dl.cacerts.digicert.com/DigiCertGlobalRootCA.crt.pem](https://dl.cacerts.digicert.com/DigiCertGlobalRootCA.crt.pem) and save the certificate file to your local drive.
105105

106-
**For Microsoft Internet Explorer and Microsoft Edge:** After the download has completed, rename the certificate to BaltimoreCyberTrustRoot.crt.pem.
106+
**For Microsoft Internet Explorer and Microsoft Edge:** After the download has completed, rename the certificate to DigiCertGlobalRootCA.crt.pem.
107107

108108
See the following links for certificates for servers in sovereign clouds: [Azure Government](https://www.digicert.com/CACerts/BaltimoreCyberTrustRoot.crt.pem), [Azure China](https://dl.cacerts.digicert.com/DigiCertGlobalRootCA.crt.pem), and [Azure Germany](https://www.d-trust.net/cgi-bin/D-TRUST_Root_Class_3_CA_2_2009.crt).
109109
1. In the `ssl` config option, replace the `ca-cert` filename with the path to this local file.
@@ -128,7 +128,7 @@ var config =
128128
password: 'your_password',
129129
database: 'quickstartdb',
130130
port: 3306,
131-
ssl: {ca: fs.readFileSync("your_path_to_ca_cert_file_BaltimoreCyberTrustRoot.crt.pem")}
131+
ssl: {ca: fs.readFileSync("your_path_to_ca_cert_file_DigiCertGlobalRootCA.crt.pem")}
132132
};
133133

134134
const conn = new mysql.createConnection(config);
@@ -195,7 +195,7 @@ var config =
195195
password: 'your_password',
196196
database: 'quickstartdb',
197197
port: 3306,
198-
ssl: {ca: fs.readFileSync("your_path_to_ca_cert_file_BaltimoreCyberTrustRoot.crt.pem")}
198+
ssl: {ca: fs.readFileSync("your_path_to_ca_cert_file_DigiCertGlobalRootCA.crt.pem")}
199199
};
200200

201201
const conn = new mysql.createConnection(config);
@@ -247,7 +247,7 @@ var config =
247247
password: 'your_password',
248248
database: 'quickstartdb',
249249
port: 3306,
250-
ssl: {ca: fs.readFileSync("your_path_to_ca_cert_file_BaltimoreCyberTrustRoot.crt.pem")}
250+
ssl: {ca: fs.readFileSync("your_path_to_ca_cert_file_DigiCertGlobalRootCA.crt.pem")}
251251
};
252252

253253
const conn = new mysql.createConnection(config);
@@ -296,7 +296,7 @@ var config =
296296
password: 'your_password',
297297
database: 'quickstartdb',
298298
port: 3306,
299-
ssl: {ca: fs.readFileSync("your_path_to_ca_cert_file_BaltimoreCyberTrustRoot.crt.pem")}
299+
ssl: {ca: fs.readFileSync("your_path_to_ca_cert_file_DigiCertGlobalRootCA.crt.pem")}
300300
};
301301

302302
const conn = new mysql.createConnection(config);

0 commit comments

Comments
 (0)