@@ -13,6 +13,7 @@ const fs = require('fs');
13
13
const path = require ( 'path' ) ;
14
14
15
15
const ip = require ( 'ip' ) ;
16
+ const tls = require ( 'tls' ) ;
16
17
const url = require ( 'url' ) ;
17
18
const http = require ( 'http' ) ;
18
19
const https = require ( 'https' ) ;
@@ -40,6 +41,16 @@ const createCertificate = require('./utils/createCertificate');
40
41
const validateOptions = require ( 'schema-utils' ) ;
41
42
const schema = require ( './options.json' ) ;
42
43
44
+ // Workaround for node ^8.6.0, ^9.0.0
45
+ // DEFAULT_ECDH_CURVE is default to prime256v1 in these version
46
+ // breaking connection when certificate is not signed with prime256v1
47
+ // change it to auto allows OpenSSL to select the curve automatically
48
+ // See https://github.com/nodejs/node/issues/16196 for more infomation
49
+ const version = parseFloat ( process . version . slice ( 1 ) ) ;
50
+ if ( version >= 8.6 && version < 10 ) {
51
+ tls . DEFAULT_ECDH_CURVE = 'auto' ;
52
+ }
53
+
43
54
const STATS = {
44
55
all : false ,
45
56
hash : true ,
@@ -581,7 +592,7 @@ function Server (compiler, options = {}, _log) {
581
592
// - https://github.com/nodejs/node/issues/21665
582
593
// - https://github.com/webpack/webpack-dev-server/issues/1449
583
594
// - https://github.com/expressjs/express/issues/3388
584
- if ( + process . version . match ( / ^ v ( \d + ) / ) [ 1 ] >= 10 ) {
595
+ if ( version >= 10 ) {
585
596
this . listeningApp = https . createServer ( options . https , app ) ;
586
597
} else {
587
598
this . listeningApp = spdy . createServer ( options . https , app ) ;
0 commit comments