Skip to content

Commit

Permalink
fix: don't hardcode path separators in conf template
Browse files Browse the repository at this point in the history
  • Loading branch information
davewasmer committed Apr 4, 2017
1 parent 32f24f7 commit b7db54a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions openssl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ default_md = sha256
name_opt = ca_default
cert_opt = ca_default
policy = policy_loose
database = DIR/index.txt
serial = DIR/serial
database = DATABASE_PATH
serial = SERIAL_PATH
prompt = no

[ policy_loose ]
Expand Down
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ export default async function devcert(appName: string, options: Options = {}) {
// us to minimize the need for elevated permissions while still allowing for per-app certificates.
async function installCertificateAuthority(installCertutil: boolean): Promise<void> {
debug(`generating openssl configuration`);
writeFileSync(opensslConfPath, readFileSync(opensslConfTemplate, 'utf-8').replace(/DIR/g, configDir));
let confTemplate = readFileSync(opensslConfTemplate, 'utf-8');
confTemplate = confTemplate.replace(/DATABASE_PATH/, configPath('index.txt'));
confTemplate = confTemplate.replace(/SERIAL_PATH/, configPath('serial'));
writeFileSync(opensslConfPath, confTemplate);
debug(`generating root certificate authority key`);
generateKey(rootKeyPath);
debug(`generating root certificate authority certificate`);
Expand Down

0 comments on commit b7db54a

Please sign in to comment.