File tree 1 file changed +6
-3
lines changed
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) {
91
91
return self . emit ( 'error' , new Error ( 'There was an error establishing an SSL connection' ) )
92
92
}
93
93
var tls = require ( 'tls' )
94
- self . stream = tls . connect ( {
94
+ const options = {
95
95
socket : self . stream ,
96
- servername : host ,
97
96
checkServerIdentity : self . ssl . checkServerIdentity || tls . checkServerIdentity ,
98
97
rejectUnauthorized : self . ssl . rejectUnauthorized ,
99
98
ca : self . ssl . ca ,
@@ -103,7 +102,11 @@ Connection.prototype.connect = function (port, host) {
103
102
cert : self . ssl . cert ,
104
103
secureOptions : self . ssl . secureOptions ,
105
104
NPNProtocols : self . ssl . NPNProtocols
106
- } )
105
+ }
106
+ if ( net . isIP ( host ) === 0 ) {
107
+ options . servername = host
108
+ }
109
+ self . stream = tls . connect ( options )
107
110
self . attachListeners ( self . stream )
108
111
self . stream . on ( 'error' , reportStreamError )
109
112
You can’t perform that action at this time.
0 commit comments