@@ -94,10 +94,12 @@ const getHelp = () => chalk`
94
94
--no-etag Send \`Last-Modified\` header instead of \`ETag\`
95
95
96
96
-S, --symlinks Resolve symlinks instead of showing 404 errors
97
+
98
+ --ssl-cert Optional path to an SSL/TLS certificate to serve with HTTPS
99
+
100
+ --ssl-key Optional path to the SSL/TLS certificate\'s private key
97
101
98
- --ssl-cert Optional path to an SSL/TLS certificate to serve with HTTPS
99
-
100
- --ssl-key Optional path to the SSL/TLS certificate\'s private key
102
+ --ssl-pass Optional path to the SSL/TLS certificate\'s passphrase
101
103
102
104
--no-port-switching Do not open a port other than the one specified when it\'s taken.
103
105
@@ -200,10 +202,13 @@ const startEndpoint = (endpoint, config, args, previous) => {
200
202
return handler ( request , response , config ) ;
201
203
} ;
202
204
205
+ const sslPass = args [ '--ssl-pass' ] ;
206
+
203
207
const server = httpMode === 'https'
204
208
? https . createServer ( {
205
209
key : fs . readFileSync ( args [ '--ssl-key' ] ) ,
206
- cert : fs . readFileSync ( args [ '--ssl-cert' ] )
210
+ cert : fs . readFileSync ( args [ '--ssl-cert' ] ) ,
211
+ passphrase : sslPass ? fs . readFileSync ( sslPass ) : ''
207
212
} , serverHandler )
208
213
: http . createServer ( serverHandler ) ;
209
214
@@ -379,6 +384,7 @@ const loadConfig = async (cwd, entry, args) => {
379
384
'--no-port-switching' : Boolean ,
380
385
'--ssl-cert' : String ,
381
386
'--ssl-key' : String ,
387
+ '--ssl-pass' : String ,
382
388
'-h' : '--help' ,
383
389
'-v' : '--version' ,
384
390
'-l' : '--listen' ,
0 commit comments