mirror of
https://github.com/key-networks/ztncui.git
synced 2025-06-07 10:43:44 +02:00
Don't try to read TLS cert files when not using HTTPS
This commit is contained in:
parent
0b36f83b34
commit
2d6d255b24
1 changed files with 5 additions and 5 deletions
10
src/bin/www
10
src/bin/www
|
@ -10,11 +10,6 @@ const http = require('http');
|
||||||
const https = require('https');
|
const https = require('https');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
const options = {
|
|
||||||
// cert: fs.readFileSync('etc/tls/fullchain.pem'),
|
|
||||||
// key: fs.readFileSync('etc/tls/privkey.pem')
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get ports from environment and store in Express.
|
* Get ports from environment and store in Express.
|
||||||
*/
|
*/
|
||||||
|
@ -50,6 +45,11 @@ if (http_all_interfaces) {
|
||||||
app.listen(http_port, 'localhost');
|
app.listen(http_port, 'localhost');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const options = !https_port ? {} : {
|
||||||
|
cert: fs.readFileSync('etc/tls/fullchain.pem'),
|
||||||
|
key: fs.readFileSync('etc/tls/privkey.pem')
|
||||||
|
};
|
||||||
|
|
||||||
const server = https.createServer(options, app);
|
const server = https.createServer(options, app);
|
||||||
|
|
||||||
if (https_port) {
|
if (https_port) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue