Skip to content

Commit 292a8d5

Browse files
committed
[opinionated] Rename optional ssl to manual ssl
1 parent d69d143 commit 292a8d5

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

bin/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ async function fromArgs() {
7979
},
8080
acme,
8181
title : (x, xs) => x || path.basename(xs.cwd),
82-
secure : (x, xs) => !!(xs.ssl.cert || xs.acme.domains.length || xs.ssl.mode === 'optional'),
82+
secure : (x, xs) => !!(xs.ssl.cert || xs.acme.domains.length || xs.ssl.mode === 'manual'),
8383
httpsPort : (x, xs) => x || (xs.secure ? (x ? parseInt(x) : (xs.port || 443)) : null),
8484
httpPort : (x, xs) => xs.secure && xs.ssl.mode === 'only' ? null : (xs.secure ? 80 : x ? parseInt(x) : (xs.port || 80)),
8585
address : x => x || env.ADDRESS || '0.0.0.0',
@@ -208,8 +208,8 @@ function getPort(x, config) {
208208

209209
function getMode(x) {
210210
x = x || env.SSL_MODE || 'redirect'
211-
if (!'only redirect optional'.includes(x))
212-
throw new Error('SSL Mode must be: only | redirect | optional')
211+
if (!'only redirect manual'.includes(x))
212+
throw new Error('SSL Mode must be: only | redirect | manual')
213213
return x
214214
}
215215

bin/start/serve.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ async function listenHttp() {
6464
})
6565
await redirect.listen(config.httpPort, config.address)
6666
console.log('HTTP Redirecting to HTTPS on', config.httpPort) // eslint-disable-line
67-
} else if (config.secure && config.ssl.mode === 'optional') {
67+
} else if (config.secure && config.ssl.mode === 'manual') {
6868
await router.listen(config.httpPort, config.address)
69-
console.log('HTTP (optional) listening on', config.httpPort) // eslint-disable-line
69+
console.log('HTTP (manual ssl) listening on', config.httpPort) // eslint-disable-line
7070
} else {
7171
await router.listen(config.httpPort, config.address)
7272
console.log('HTTP Listening on', config.httpPort) // eslint-disable-line

shared/server/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export default function Server({
127127

128128
port = parseInt(port)
129129
wrapper = wrap
130-
isSsl = !!(o.cert || o.mode === 'optional')
130+
isSsl = !!(o.cert || o.mode === 'manual')
131131
uws = isSsl
132132
? uWS.SSLApp({ cert_file_name: o.cert, key_file_name: o.key, ...o })
133133
: uWS.App(o)

shared/server/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export default class Request {
146146
}
147147

148148
get protocol() {
149-
return this.options.cert || this.options.mode === 'optional'
149+
return this.options.cert || this.options.mode === 'manual'
150150
? 'https'
151151
: header(this, 'x-forwarded-proto') || 'http'
152152
}

0 commit comments

Comments
 (0)