Arcadei...

This commit is contained in:
paoloar77
2022-10-27 11:22:58 +02:00
parent 8a7767e3a4
commit 663eb34cfa
5 changed files with 99 additions and 3 deletions

View File

@@ -48,12 +48,15 @@ if ((process.env.NODE_ENV === 'production') ||
};
var https = require('https');
} else {
if (process.env.HTTPS_LOCALHOST) {
if (process.env.HTTPS_LOCALHOST === "true") {
var privateKey = fs.readFileSync(process.env.PATH_CERT_KEY, 'utf8');
var certificate = fs.readFileSync(process.env.PATH_SERVER_CRT, 'utf8');
var credentials = {
key: privateKey,
cert: certificate,
ciphers: 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES256-SHA384',
honorCipherOrder: true,
secureProtocol: 'TLSv1_2_method',
};
var https = require('https');
@@ -98,6 +101,7 @@ myLoad().then(ris => {
require('./models/mailinglist');
require('./models/newstosent');
require('./models/mypage');
require('./models/myelem');
require('./models/bot');
require('./models/calzoom');
const mysql_func = require('./mysql/mysql_func');
@@ -231,7 +235,7 @@ myLoad().then(ris => {
}
if ((process.env.NODE_ENV === 'production') ||
(process.env.NODE_ENV === 'test') || process.env.HTTPS_LOCALHOST) {
(process.env.NODE_ENV === 'test') || process.env.HTTPS_LOCALHOST === "true") {
var httpsServer = https.createServer(credentials, app);
console.log('httpsServer: port ', port);
httpsServer.listen(port);