devcert-sanscache
Advanced tools
Comparing version 0.4.3 to 0.4.5
export default function generateDevCert(commonName: string): Promise<{ | ||
key: string; | ||
cert: string; | ||
ca: string; | ||
}>; |
@@ -16,6 +16,7 @@ "use strict"; | ||
await install_authority_1.default(commonName, rootCertPath); | ||
const { keyPath, certPath } = openssl_1.generateSignedCertificate(commonName, opensslConfPath, rootKeyPath, rootCertPath); | ||
const { keyPath, certPath, caPath } = openssl_1.generateSignedCertificate(commonName, opensslConfPath, rootKeyPath, rootCertPath); | ||
const key = fs.readFileSync(keyPath).toString(); | ||
const cert = fs.readFileSync(certPath).toString(); | ||
return { key, cert }; | ||
const ca = fs.readFileSync(caPath).toString(); | ||
return { key, cert, ca }; | ||
} | ||
@@ -22,0 +23,0 @@ finally { |
@@ -9,5 +9,6 @@ export declare function tmpFile(name: string): string; | ||
}; | ||
export declare function generateSignedCertificate(commonName: string, opensslConfPath: string, rootKeyPath: string, rootCertPath: string): { | ||
export declare function generateSignedCertificate(commonName: string, opensslConfPath: string, rootKeyPath: string, caPath: string): { | ||
keyPath: string; | ||
certPath: string; | ||
caPath: string; | ||
}; |
@@ -139,3 +139,3 @@ "use strict"; | ||
exports.generateRootCertificate = generateRootCertificate; | ||
function generateSignedCertificate(commonName, opensslConfPath, rootKeyPath, rootCertPath) { | ||
function generateSignedCertificate(commonName, opensslConfPath, rootKeyPath, caPath) { | ||
const keyPath = generateKey(); | ||
@@ -149,7 +149,7 @@ process.env.SAN = commonName; | ||
mkdirp.sync(caCertsDir); | ||
openssl(`ca -config ${opensslConfPath} -in ${csrFile} -out ${certPath} -outdir ${caCertsDir} -keyfile ${rootKeyPath} -cert ${rootCertPath} -notext -md sha256 -days 7000 -batch -extensions server_cert`); | ||
openssl(`ca -config ${opensslConfPath} -in ${csrFile} -out ${certPath} -outdir ${caCertsDir} -keyfile ${rootKeyPath} -cert ${caPath} -notext -md sha256 -days 7000 -batch -extensions server_cert`); | ||
rimraf.sync(caCertsDir); | ||
return { keyPath, certPath }; | ||
return { keyPath, certPath, caPath }; | ||
} | ||
exports.generateSignedCertificate = generateSignedCertificate; | ||
//# sourceMappingURL=openssl.js.map |
{ | ||
"name": "devcert-sanscache", | ||
"version": "0.4.3", | ||
"version": "0.4.5", | ||
"description": "Generate trusted local SSL/TLS certificates for local SSL development", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
29167
366