Skip to content

Commit

Permalink
Don't set servername if host is an IP
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevon committed Jul 25, 2022
1 parent a0ef955 commit d0ac51e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/network/socketFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ module.exports = () => {

return ({ host, port, ssl, onConnect }) => {
const socket = ssl
? tls.connect(Object.assign({ host, port, servername: host }, ssl), onConnect)
? tls.connect(
Object.assign({ host, port }, !net.isIP(host) ? { servername: host } : {}, ssl),
onConnect
)
: net.connect({ host, port }, onConnect)

socket.setKeepAlive(true, KEEP_ALIVE_DELAY)
Expand Down

0 comments on commit d0ac51e

Please sign in to comment.