Automatically enable protocolUseSSL when useSSL is set

This makes the behavior consistent with the docs and
 saves the user from having to both set
 `useSSL` and `protocolUseSSL`.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-05-04 11:51:06 +02:00
parent 140b2c261c
commit aece96f539
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -1,4 +1,3 @@
'use strict'
const crypto = require('crypto')
@ -88,6 +87,14 @@ config.isStandardHTTPPort = (function isStandardHTTPPort () {
return !config.useSSL && config.port === 80
})()
// Use HTTPS protocol if the internal TLS server is enabled
if (config.useSSL === true) {
if (config.protocolUseSSL === false) {
logger.warn('Overriding protocolUseSSL to \'true\' as useSSL is enabled.')
}
config.protocolUseSSL = true
}
// cache serverURL
config.serverURL = (function getserverurl () {
let url = ''