diff --git a/lib/base/connection.js b/lib/base/connection.js index b8bc90af8a..287f07afd3 100644 --- a/lib/base/connection.js +++ b/lib/base/connection.js @@ -345,7 +345,11 @@ class BaseConnection extends EventEmitter { }); const rejectUnauthorized = this.config.ssl.rejectUnauthorized; const verifyIdentity = this.config.ssl.verifyIdentity; - const servername = this.config.host; + let servername = undefined; + // only set servername for SNI and identity check if host is not an IP address + if (!Net.isIP(this.config.host)) { + servername = this.config.host; + } let secureEstablished = false; this.stream.removeAllListeners('data');