SSL code snippets and backing comments

skysql_field
Rob Hedgpeth 2020-03-31 10:01:33 -05:00
rodzic 5bf7a082fa
commit 0bfa252339
4 zmienionych plików z 45 dodań i 19 usunięć

Wyświetl plik

@ -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
}*/
});

Wyświetl plik

@ -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={

Wyświetl plik

@ -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={

Wyświetl plik

@ -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({