node/test/parallel/test-tls-ip-servername-forbidden.js
James M Snell 790acc8689
tls: move IP-address servername deprecation to eol
Has been deprecated for six years. It's time to remove it.

PR-URL: https://github.com/nodejs/node/pull/58533
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2025-06-02 19:01:00 +00:00

19 lines
393 B
JavaScript

'use strict';
const common = require('../common');
const { throws } = require('assert');
if (!common.hasCrypto)
common.skip('missing crypto');
const tls = require('tls');
// Verify that passing an IP address the the servername option
// throws an error.
throws(() => tls.connect({
port: 1234,
servername: '127.0.0.1',
}, common.mustNotCall()), {
code: 'ERR_INVALID_ARG_VALUE',
});