mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
⚡ Make sure that it looks for SSL certs only if defined
This commit is contained in:
parent
60826ba19d
commit
7c5f437e92
|
@ -177,13 +177,13 @@ const config = convict({
|
|||
},
|
||||
ssl_key: {
|
||||
format: String,
|
||||
default: 'server.key',
|
||||
default: '',
|
||||
env: 'N8N_SSL_KEY',
|
||||
doc: 'SSL Key for HTTPS Protocol'
|
||||
},
|
||||
ssl_cert: {
|
||||
format: String,
|
||||
default: 'server.pem',
|
||||
default: '',
|
||||
env: 'N8N_SSL_CERT',
|
||||
doc: 'SSL Cert for HTTPS Protocol'
|
||||
},
|
||||
|
|
|
@ -1268,10 +1268,10 @@ export async function start(): Promise<void> {
|
|||
|
||||
let server;
|
||||
|
||||
if(app.protocol === 'https'){
|
||||
if (app.protocol === 'https' && app.sslKey && app.sslCert){
|
||||
const https = require('https');
|
||||
const privateKey = readFileSync(app.sslKey,'utf8');
|
||||
const cert = readFileSync(app.sslCert,'utf8');
|
||||
const privateKey = readFileSync(app.sslKey, 'utf8');
|
||||
const cert = readFileSync(app.sslCert, 'utf8');
|
||||
const credentials = { key: privateKey,cert };
|
||||
server = https.createServer(credentials,app.app);
|
||||
}else{
|
||||
|
|
Loading…
Reference in a new issue