Make the cert subject match

This commit is contained in:
Johannes Zellner
2018-11-15 14:18:34 +01:00
parent 2628678d82
commit ab255e78c5

View File

@@ -131,7 +131,7 @@ function providerMatchesSync(domainObject, certFilePath, apiOptions) {
const subjectAndIssuer = safe.child_process.execSync(`/usr/bin/openssl x509 -noout -subject -issuer -in "${certFilePath}"`, { encoding: 'utf8' });
const subject = subjectAndIssuer.match(/^subject=CN = (.*)$/m)[1];
const subject = subjectAndIssuer.match(/^subject=(.*)$/m)[1];
const issuer = subjectAndIssuer.match(/^issuer=(.*)$/m)[1];
const isWildcardCert = subject.includes('*');
const isLetsEncryptProd = issuer.includes('Let\'s Encrypt Authority');