File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-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+ let 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,12 @@ 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+
110+ self . stream = tls . connect ( options ) ;
107111 self . attachListeners ( self . stream )
108112 self . stream . on ( 'error' , reportStreamError )
109113
You can’t perform that action at this time.
0 commit comments