test: replace localhost IP with 'localhost' for TLS conformity

test-https-connect-localport currently causes a runtime deprecation
warning: "[DEP0123] DeprecationWarning: Setting the TLS ServerName
to an IP address is not permitted by RFC 6066. This will be ignored
in a future version."

Change IP usage to the string 'localhost' instead.

PR-URL: https://github.com/nodejs/node/pull/26881
Fixes: https://github.com/https://github.com/nodejs/node/issues/26862
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
This commit is contained in:
Rich Trott 2019-03-23 09:37:32 -07:00
parent 229759f961
commit f5969f08a0

View File

@ -15,10 +15,10 @@ const assert = require('assert');
}, common.mustCall(function(req, res) {
this.close();
res.end();
})).listen(0, common.localhostIPv4, common.mustCall(function() {
})).listen(0, 'localhost', common.mustCall(function() {
const port = this.address().port;
const req = https.get({
host: common.localhostIPv4,
host: 'localhost',
pathname: '/',
port,
family: 4,