Software /
code /
prosody
Comparison
util/x509.lua @ 10256:b2e7b07f8b74
util.x509: Only collect commonNames that pass idna
Weeds out "Example Certificate" and the like, which are uninteresting
for this function.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 10 Sep 2019 18:17:13 +0200 |
parent | 10255:8e8d3b3a55da |
child | 10259:9df135b06c2f |
comparison
equal
deleted
inserted
replaced
10255:8e8d3b3a55da | 10256:b2e7b07f8b74 |
---|---|
236 local subject = cert:subject(); | 236 local subject = cert:subject(); |
237 for i = 1, #subject do | 237 for i = 1, #subject do |
238 local dn = subject[i]; | 238 local dn = subject[i]; |
239 if dn.oid == oid_commonname then | 239 if dn.oid == oid_commonname then |
240 local name = nameprep(dn.value); | 240 local name = nameprep(dn.value); |
241 if name then | 241 if name and idna_to_ascii(name) then |
242 names[name] = true; | 242 names[name] = true; |
243 end | 243 end |
244 end | 244 end |
245 end | 245 end |
246 return names; | 246 return names; |