Skip to content

Commit

Permalink
generate unique certificate serial numbers (#1830)
Browse files Browse the repository at this point in the history
Fixes browser errors thrown due to multiple certificates using the same issuer and serial number.  Occurs when a self-signed certificate has already been stored in the browser and new certificate is generated; either in the same project or across project installations.
  • Loading branch information
dehuszar authored and DeMoorJasper committed Jul 31, 2018
1 parent e4ec369 commit c334b2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/generateCertificate.js
Expand Up @@ -27,7 +27,7 @@ function generateCertificate(options = {}) {
const cert = pki.createCertificate();

cert.publicKey = keys.publicKey;
cert.serialNumber = '01';
cert.serialNumber = Date.now().toString();
cert.validity.notBefore = new Date();
cert.validity.notAfter = new Date();
cert.validity.notAfter.setFullYear(cert.validity.notBefore.getFullYear() + 1);
Expand Down

0 comments on commit c334b2f

Please sign in to comment.