node-opcua-pki 6.13.0 → 6.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/pki.mjs CHANGED
@@ -2683,15 +2683,16 @@ nsComment = "CA Generated by Node-OPCUA Certificate utility usin
2683
2683
  subjectKeyIdentifier = hash
2684
2684
  basicConstraints = CA:TRUE
2685
2685
  keyUsage = critical, cRLSign, keyCertSign
2686
+ subjectAltName = $ENV::ALTNAME
2686
2687
  nsComment = "CA CSR generated by Node-OPCUA Certificate utility using openssl"
2687
2688
  [ v3_ca ]
2688
2689
  subjectKeyIdentifier = hash
2689
2690
  authorityKeyIdentifier = keyid:always,issuer:always
2690
2691
  basicConstraints = CA:TRUE
2691
2692
  keyUsage = critical, cRLSign, keyCertSign
2693
+ subjectAltName = $ENV::ALTNAME
2692
2694
  nsComment = "CA Certificate generated by Node-OPCUA Certificate utility using openssl"
2693
2695
  #nsCertType = sslCA, emailCA
2694
- #subjectAltName = email:copy
2695
2696
  #issuerAltName = issuer:copy
2696
2697
  #obj = DER:02:03
2697
2698
  crlDistributionPoints = @crl_info
@@ -2787,7 +2788,8 @@ async function construct_CertificateAuthority(certificateAuthority) {
2787
2788
  await fs10.promises.writeFile(caConfigFile, data);
2788
2789
  }
2789
2790
  const subjectOpt = ` -subj "${subject.toString()}" `;
2790
- processAltNames({});
2791
+ const caCommonName = subject.commonName || "NodeOPCUA-CA";
2792
+ setEnv("ALTNAME", `URI:urn:${caCommonName}`);
2791
2793
  const options = { cwd: caRootDir };
2792
2794
  const configFile = generateStaticConfig("conf/caconfig.cnf", options);
2793
2795
  const configOption = ` -config ${q4(n5(configFile))}`;