SSL code snippets and backing comments
rodzic
5bf7a082fa
commit
0bfa252339
|
@ -1,6 +1,12 @@
|
|||
var mariadb = require('mariadb');
|
||||
require('dotenv').config();
|
||||
|
||||
// SSL (e.g. SkySQL) connections
|
||||
// * Remember to change the location of "skysql_chain.pem" to wherever you placed it!
|
||||
// * To use just uncomment the two lines below and the 'ssl' property (and value)
|
||||
|
||||
//const fs = require("fs");
|
||||
//const serverCert = [fs.readFileSync("skysql_chain.pem", "utf8")];
|
||||
|
||||
const pool = mariadb.createPool({
|
||||
host: process.env.DB_HOST,
|
||||
|
@ -9,11 +15,11 @@ const pool = mariadb.createPool({
|
|||
port: process.env.DB_PORT,
|
||||
multipleStatements: true,
|
||||
connectionLimit: 5
|
||||
/*timezone: 'UTC',
|
||||
dateStrings: [
|
||||
'DATE',
|
||||
'DATETIME'
|
||||
]*/
|
||||
// For SSL (e.g. SkySQL) connections
|
||||
/*
|
||||
,ssl: {
|
||||
ca: serverCert
|
||||
}*/
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
var mariadb = require('mariadb');
|
||||
require('dotenv').config();
|
||||
|
||||
// SSL (e.g. SkySQL) connections
|
||||
// * Remember to change the location of "skysql_chain.pem" to wherever you placed it!
|
||||
// * To use just uncomment the two lines below and the 'ssl' property (and value)
|
||||
|
||||
//const fs = require("fs");
|
||||
//const serverCert = [fs.readFileSync("skysql_chain.pem", "utf8")];
|
||||
|
||||
const pool = mariadb.createPool({
|
||||
host: process.env.DB_HOST,
|
||||
user: process.env.DB_USER,
|
||||
|
@ -9,6 +16,11 @@ const pool = mariadb.createPool({
|
|||
database: process.env.DB_NAME,
|
||||
multipleStatements: true,
|
||||
connectionLimit: 5
|
||||
// For SSL (e.g. SkySQL) connections
|
||||
/*
|
||||
,ssl: {
|
||||
ca: serverCert
|
||||
}*/
|
||||
});
|
||||
|
||||
module.exports={
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
const fs = require("fs");
|
||||
var mariadb = require('mariadb');
|
||||
require('dotenv').config();
|
||||
|
||||
// For SSL connections
|
||||
// SSL (e.g. SkySQL) connections
|
||||
// * Remember to change the location of "skysql_chain.pem" to wherever you placed it!
|
||||
// * To use just uncomment the two lines below and the 'ssl' property (and value)
|
||||
|
||||
//const fs = require("fs");
|
||||
//const serverCert = [fs.readFileSync("skysql_chain.pem", "utf8")];
|
||||
|
||||
var pools = [
|
||||
|
@ -14,19 +17,12 @@ var pools = [
|
|||
database: process.env.DB_NAME_1,
|
||||
multipleStatements: true,
|
||||
connectionLimit: 5
|
||||
})/*,
|
||||
mariadb.createPool({
|
||||
host: '<host_address>',
|
||||
user:'<user>',
|
||||
password: '<password>',
|
||||
database: 'orders',
|
||||
port: 5002,
|
||||
multipleStatements: true,
|
||||
connectionLimit: 5,
|
||||
ssl: {
|
||||
// For SSL (e.g. SkySQL) connections
|
||||
/*
|
||||
,ssl: {
|
||||
ca: serverCert
|
||||
}
|
||||
})*/
|
||||
}*/
|
||||
})
|
||||
];
|
||||
|
||||
module.exports={
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
var mariadb = require('mariadb');
|
||||
require('dotenv').config();
|
||||
|
||||
// SSL (e.g. SkySQL) connections
|
||||
// * Remember to change the location of "skysql_chain.pem" to wherever you placed it!
|
||||
// * To use just uncomment the two lines below and the 'ssl' property (and value)
|
||||
|
||||
//const fs = require("fs");
|
||||
//const serverCert = [fs.readFileSync("skysql_chain.pem", "utf8")];
|
||||
|
||||
const pool = mariadb.createPool({
|
||||
host: 'localhost',
|
||||
user:'root',
|
||||
|
@ -8,6 +15,11 @@ const pool = mariadb.createPool({
|
|||
database: 'Places',
|
||||
multipleStatements: true,
|
||||
connectionLimit: 5
|
||||
// For SSL (e.g. SkySQL) connections
|
||||
/*
|
||||
,ssl: {
|
||||
ca: serverCert
|
||||
}*/
|
||||
});
|
||||
|
||||
const pool = mariadb.createPool({
|
||||
|
|
Ładowanie…
Reference in New Issue