diff --git a/lib/certs.js b/lib/certs.js index 6c0f514..60b0efd 100644 --- a/lib/certs.js +++ b/lib/certs.js @@ -104,7 +104,8 @@ function detect(options, callback) { } if (!validOnly || !invalid) { - const teamId = cert.subject.attributes.find(attr => attr.name === 'organizationalUnitName'); + const teamId = cert.subject.getField('OU').value; + const teamName = cert.subject.getField('O').value; dest.push({ name: certName, fullname: appc.encoding.decodeOctalUTF8(commonName).trim(), @@ -113,7 +114,8 @@ function detect(options, callback) { after: cert.validity.notAfter, expired: expired, invalid: invalid, - teamId: teamId && teamId.value + teamId: teamId, + teamName: appc.encoding.decodeOctalUTF8(teamName).trim() }); }