Skip to content

Commit 2032f7f

Browse files
authored
Update certificate.js
changed subject to -ext subjectAltName to be more RFC compatible
1 parent 7322d35 commit 2032f7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/internal/certificate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,10 +728,10 @@ const internalCertificate = {
728728
getCertificateInfoFromFile: (certificate_file, throw_expired) => {
729729
let certData = {};
730730

731-
return utils.exec('openssl x509 -in ' + certificate_file + ' -subject -noout')
731+
return utils.exec('openssl x509 -in ' + certificate_file + ' -ext subjectAltName -noout')
732732
.then((result) => {
733733
// subject=CN = something.example.com
734-
const regex = /(?:subject=)?[^=]+=\s+(\S+)/gim;
734+
const regex = /^DNS:([^,]+)/gim;
735735
const match = regex.exec(result);
736736

737737
if (typeof match[1] === 'undefined') {

0 commit comments

Comments
 (0)