From 30e237041d5cd7c39e33a9382c96f109be23337d Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 17 Jan 2013 16:32:00 +0100 Subject: [PATCH] Revert "tls: allow wildcards in common name" This reverts commit 45024e7b7551eca7796e16fe453b2cbaee94b916. It's making test/simple/test-tls-check-server-identity.js fail: AssertionError: Test#4 failed: { host: 'b.a.com', cert: { subject: { CN: '*.a.com' } }, result: false } at /test/simple/test-tls-check-server-identity.js:201:10 --- lib/tls.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tls.js b/lib/tls.js index d6518f502a..c62d40f8f3 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -156,13 +156,14 @@ function checkServerIdentity(host, cert) { dnsNames = dnsNames.concat(uriNames); // And only after check if hostname matches CN + // (because CN is deprecated, but should be used for compatiblity anyway) var commonNames = cert.subject.CN; if (Array.isArray(commonNames)) { for (var i = 0, k = commonNames.length; i < k; ++i) { - dnsNames.push(regexpify(commonNames[i], true)); + dnsNames.push(regexpify(commonNames[i], false)); } } else { - dnsNames.push(regexpify(commonNames, true)); + dnsNames.push(regexpify(commonNames, false)); } valid = dnsNames.some(function(re) {