Skip to content

Commit

Permalink
fix(NODE-3109): prevent servername from being IP (#2763)
Browse files Browse the repository at this point in the history
servername should only ever be a hostname. Add a condition
to check if the host is an IP and skip auto setting the servername.
  • Loading branch information
nbbeeken committed Mar 29, 2021
1 parent 9256242 commit 312ffef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/connection/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ function parseSslOptions(family, options) {
}

// Set default sni servername to be the same as host
if (result.servername == null) {
if (result.servername == null && !net.isIP(result.host)) {
result.servername = result.host;
}

Expand Down

0 comments on commit 312ffef

Please sign in to comment.