summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-01-17 16:32:00 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2013-01-17 16:32:00 +0100
commit30e237041d5cd7c39e33a9382c96f109be23337d (patch)
tree637f4ed47906be0081ff68236fb78cb9421927f5 /lib
parent08ac9fe016e333a344469aa7e8a1fb483ae27c58 (diff)
downloadnode-new-30e237041d5cd7c39e33a9382c96f109be23337d.tar.gz
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 <omitted>/test/simple/test-tls-check-server-identity.js:201:10
Diffstat (limited to 'lib')
-rw-r--r--lib/tls.js5
1 files 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) {