@@ -20,6 +20,8 @@ const https = require('https');
2020const spdy = require ( 'spdy' ) ;
2121const sockjs = require ( 'sockjs' ) ;
2222
23+ const semver = require ( 'semver' ) ;
24+
2325const killable = require ( 'killable' ) ;
2426
2527const del = require ( 'del' ) ;
@@ -46,8 +48,7 @@ const schema = require('./options.json');
4648// breaking connection when certificate is not signed with prime256v1
4749// change it to auto allows OpenSSL to select the curve automatically
4850// 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' ) ) {
5152 tls . DEFAULT_ECDH_CURVE = 'auto' ;
5253}
5354
@@ -592,7 +593,7 @@ function Server (compiler, options = {}, _log) {
592593 // - https://github.com/nodejs/node/issues/21665
593594 // - https://github.com/webpack/webpack-dev-server/issues/1449
594595 // - https://github.com/expressjs/express/issues/3388
595- if ( version >= 10 ) {
596+ if ( semver . gte ( process . version , '10.0.0' ) ) {
596597 this . listeningApp = https . createServer ( options . https , app ) ;
597598 } else {
598599 this . listeningApp = spdy . createServer ( options . https , app ) ;
0 commit comments