Skip to content

Commit

Permalink
common name sanitization
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jan 8, 2020
1 parent 651bb8e commit 571f4e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import fs = require('fs');
export default async function generateDevCert (commonName: string) {
if (!commandExists.sync('openssl'))
throw new Error('Unable to find openssl - make sure it is installed and available in your PATH');
if (!commonName.match(/^(.|\.){1,64}$/))
if (!commonName.match(/^(a-zA-Z0-9|\.){1,64}$/))
throw new Error(`Invalid Common Name ${commonName}.`);
try {
const opensslConfPath = generateOpensslConf(commonName);
Expand Down

0 comments on commit 571f4e6

Please sign in to comment.