Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Dawson <michael_dawson@ca.ibm.com>2017-06-30 02:20:11 +0300
committerMichael Dawson <michael_dawson@ca.ibm.com>2017-07-18 21:03:23 +0300
commit3ccfeb483df5a6402da9b40346a7eb33cfb4b70a (patch)
tree878d224d17cfd4e9106f0871279110a913beec1e /lib/tls.js
parentf406a7ebaee09c00b6dec330e17897924096c30d (diff)
tls: migrate tls.js to use internal/errors.js
Migrate tls.js to use internal/errors.js as per https://github.com/nodejs/node/issues/11273 PR-URL: https://github.com/nodejs/node/pull/13994 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'lib/tls.js')
-rw-r--r--lib/tls.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/tls.js b/lib/tls.js
index d89f241383d..30525a254c5 100644
--- a/lib/tls.js
+++ b/lib/tls.js
@@ -21,6 +21,7 @@
'use strict';
+const errors = require('internal/errors');
const internalUtil = require('internal/util');
internalUtil.assertCrypto();
@@ -219,8 +220,7 @@ exports.checkServerIdentity = function checkServerIdentity(host, cert) {
}
if (!valid) {
- const err = new Error(
- `Hostname/IP doesn't match certificate's altnames: "${reason}"`);
+ const err = new errors.Error('ERR_TLS_CERT_ALTNAME_INVALID', reason);
err.reason = reason;
err.host = host;
err.cert = cert;