File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,8 @@ Connection.prototype.connect = function (port, host) {
9191 return self . emit ( 'error' , new Error ( 'There was an error establishing an SSL connection' ) )
9292 }
9393 var tls = require ( 'tls' )
94- self . stream = tls . connect ( {
94+ const options = {
9595 socket : self . stream ,
96- servername : host ,
9796 checkServerIdentity : self . ssl . checkServerIdentity || tls . checkServerIdentity ,
9897 rejectUnauthorized : self . ssl . rejectUnauthorized ,
9998 ca : self . ssl . ca ,
@@ -103,7 +102,11 @@ Connection.prototype.connect = function (port, host) {
103102 cert : self . ssl . cert ,
104103 secureOptions : self . ssl . secureOptions ,
105104 NPNProtocols : self . ssl . NPNProtocols
106- } )
105+ }
106+ if ( net . isIP ( host ) === 0 ) {
107+ options . servername = host
108+ }
109+ self . stream = tls . connect ( options )
107110 self . attachListeners ( self . stream )
108111 self . stream . on ( 'error' , reportStreamError )
109112
You can’t perform that action at this time.
0 commit comments