@@ -20,6 +20,8 @@ const https = require('https');
20
20
const spdy = require ( 'spdy' ) ;
21
21
const sockjs = require ( 'sockjs' ) ;
22
22
23
+ const semver = require ( 'semver' ) ;
24
+
23
25
const killable = require ( 'killable' ) ;
24
26
25
27
const del = require ( 'del' ) ;
@@ -46,8 +48,7 @@ const schema = require('./options.json');
46
48
// breaking connection when certificate is not signed with prime256v1
47
49
// change it to auto allows OpenSSL to select the curve automatically
48
50
// 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
+ if ( semver . satisfies ( process . version , '8.6.0 - 9' ) ) {
51
52
tls . DEFAULT_ECDH_CURVE = 'auto' ;
52
53
}
53
54
@@ -592,7 +593,7 @@ function Server (compiler, options = {}, _log) {
592
593
// - https://github.com/nodejs/node/issues/21665
593
594
// - https://github.com/webpack/webpack-dev-server/issues/1449
594
595
// - https://github.com/expressjs/express/issues/3388
595
- if ( version >= 10 ) {
596
+ if ( semver . gte ( process . version , '10.0.0' ) ) {
596
597
this . listeningApp = https . createServer ( options . https , app ) ;
597
598
} else {
598
599
this . listeningApp = spdy . createServer ( options . https , app ) ;
0 commit comments