Skip to content

Commit 312ffef

Browse files
authored
fix(NODE-3109): prevent servername from being IP (#2763)
servername should only ever be a hostname. Add a condition to check if the host is an IP and skip auto setting the servername.
1 parent 9256242 commit 312ffef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/core/connection/connect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ function parseSslOptions(family, options) {
243243
}
244244

245245
// Set default sni servername to be the same as host
246-
if (result.servername == null) {
246+
if (result.servername == null && !net.isIP(result.host)) {
247247
result.servername = result.host;
248248
}
249249

0 commit comments

Comments
 (0)