diff --git a/packages/cli/config/index.ts b/packages/cli/config/index.ts index 2452bdd67f..a3b800279e 100644 --- a/packages/cli/config/index.ts +++ b/packages/cli/config/index.ts @@ -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' }, diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index 42bed2942e..2664dcf5a7 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -1268,10 +1268,10 @@ export async function start(): Promise { 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{