File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -240,14 +240,25 @@ function Server(compiler, options) {
240
240
features [ feature ] ( ) ;
241
241
} , this ) ;
242
242
243
- this . listeningApp = options . https
244
- ? https . createServer ( {
245
- // using built-in self-signed certificate
246
- key : options . key || fs . readFileSync ( path . join ( __dirname , "../ssl/server.key" ) ) ,
247
- cert : options . cert || fs . readFileSync ( path . join ( __dirname , "../ssl/server.crt" ) ) ,
248
- ca : options . ca || fs . readFileSync ( path . join ( __dirname , "../ssl/ca.crt" ) )
249
- } , app )
250
- : http . createServer ( app ) ;
243
+ if ( options . https ) {
244
+ // for keep supporting CLI parameters
245
+ if ( typeof options . https === 'boolean' ) {
246
+ options . https = {
247
+ key : options . key ,
248
+ cert : options . cert ,
249
+ ca : options . ca
250
+ } ;
251
+ }
252
+
253
+ // using built-in self-signed certificate if no certificate was configured
254
+ options . https . key = options . https . key || fs . readFileSync ( path . join ( __dirname , "../ssl/server.key" ) ) ;
255
+ options . https . cert = options . https . cert || fs . readFileSync ( path . join ( __dirname , "../ssl/server.crt" ) ) ;
256
+ options . https . ca = options . https . ca || fs . readFileSync ( path . join ( __dirname , "../ssl/ca.crt" ) ) ;
257
+
258
+ this . listeningApp = https . createServer ( options . https , app ) ;
259
+ } else {
260
+ this . listeningApp = http . createServer ( app ) ;
261
+ }
251
262
}
252
263
253
264
Server . prototype . use = function ( ) {
You can’t perform that action at this time.
0 commit comments