mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
backend: fixed ssl
This commit is contained in:
parent
deec1070b5
commit
1a7b097553
1 changed files with 5 additions and 5 deletions
|
@ -8,7 +8,7 @@ const https = require('https');
|
||||||
|
|
||||||
if (CONFIG.HTTP.ENABLED) {
|
if (CONFIG.HTTP.ENABLED) {
|
||||||
const httpPort = CONFIG.HTTP.PORT;
|
const httpPort = CONFIG.HTTP.PORT;
|
||||||
app.set('port', httpPort);
|
// app.set('port', httpPort);
|
||||||
|
|
||||||
const httpServer = http.createServer(app);
|
const httpServer = http.createServer(app);
|
||||||
httpServer.listen(httpPort);
|
httpServer.listen(httpPort);
|
||||||
|
@ -19,13 +19,13 @@ if (CONFIG.HTTP.ENABLED) {
|
||||||
|
|
||||||
if (CONFIG.HTTPS.ENABLED) {
|
if (CONFIG.HTTPS.ENABLED) {
|
||||||
const sslPort = CONFIG.HTTPS.PORT;
|
const sslPort = CONFIG.HTTPS.PORT;
|
||||||
app.set('port', sslPort);
|
// app.set('port', sslPort);
|
||||||
|
|
||||||
const privateKey = fs.readFileSync(CONFIG.HTTPS.PRIVATE_KEY, 'utf8');
|
const key = fs.readFileSync(CONFIG.HTTPS.PRIVATE_KEY, 'utf8');
|
||||||
const certificate = fs.readFileSync(CONFIG.HTTPS.CERTIFICATE, 'utf8');
|
const cert = fs.readFileSync(CONFIG.HTTPS.CERTIFICATE, 'utf8');
|
||||||
const ca = fs.readFileSync(CONFIG.HTTPS.CA, 'utf8');
|
const ca = fs.readFileSync(CONFIG.HTTPS.CA, 'utf8');
|
||||||
|
|
||||||
const sslServer = https.createServer({ privateKey, certificate, ca }, app);
|
const sslServer = https.createServer({ key, cert, ca }, app);
|
||||||
|
|
||||||
sslServer.listen(sslPort);
|
sslServer.listen(sslPort);
|
||||||
sslServer.on('error', console.log);
|
sslServer.on('error', console.log);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue