Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

devcert

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devcert - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

3

dist/certificate-authority.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.uninstall = exports.ensureCACertReadable = exports.withCertificateAuthorityCredentials = void 0;
const tslib_1 = require("tslib");

@@ -129,2 +130,2 @@ const fs_1 = require("fs");

exports.uninstall = uninstall;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VydGlmaWNhdGUtYXV0aG9yaXR5LmpzIiwic291cmNlUm9vdCI6Ii9Vc2Vycy9qemV0bGVuL2dpdHMvZGV2Y2VydC8iLCJzb3VyY2VzIjpbImNlcnRpZmljYXRlLWF1dGhvcml0eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwyQkFJWTtBQUNaLDBEQUFnQztBQUVoQywyQ0FXcUI7QUFDckIsb0VBQTBDO0FBQzFDLG1DQUF5QztBQUN6QyxpREFBNkM7QUFHN0MsTUFBTSxLQUFLLEdBQUcsZUFBVyxDQUFDLCtCQUErQixDQUFDLENBQUM7QUFFM0Q7OztHQUdHO0FBQ0gscUNBQTBELFVBQW1CLEVBQUU7O1FBQzdFLEtBQUssQ0FBQyxxRkFBcUYsQ0FBQyxDQUFDO1FBQzdGLFNBQVMsRUFBRSxDQUFDO1FBQ1osNEJBQWdCLEVBQUUsQ0FBQztRQUVuQixLQUFLLENBQUMsd0RBQXdELENBQUMsQ0FBQztRQUNoRSxJQUFJLFdBQVcsR0FBRyxhQUFLLEVBQUUsQ0FBQztRQUUxQixLQUFLLENBQUMsZ0ZBQWdGLENBQUMsQ0FBQztRQUN4RixlQUFlLEVBQUUsQ0FBQztRQUVsQixLQUFLLENBQUMsMEJBQT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IHBvc3NpYmxlIHRoYXQgdGhlIGNvbW1hbmQgdG8gdW50cnVzdCB3aWxsIG5vdCB3b3JrLCBhbmQgd2UnbGxcbiAqIHNpbGVudGx5IGZhaWwgdGhhdCBhcyB3ZWxsOyB3aXRoIG5vIGV4aXN0aW5nIGNlcnRpZmljYXRlcyBhbnltb3JlLCB0aGVcbiAqIHNlY3VyaXR5IGV4cG9zdXJlIHRoZXJlIGlzIG1pbmltYWwuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiB1bmluc3RhbGwoKTogdm9pZCB7XG4gIGN1cnJlbnRQbGF0Zm9ybS5yZW1vdmVGcm9tVHJ1c3RTdG9yZXMocm9vdENBQ2VydFBhdGgpO1xuICBjdXJyZW50UGxhdGZvcm0uZGVsZXRlUHJvdGVjdGVkRmlsZXMoZG9tYWluc0Rpcik7XG4gIGN1cnJlbnRQbGF0Zm9ybS5kZWxldGVQcm90ZWN0ZWRGaWxlcyhyb290Q0FEaXIpO1xuICBjdXJyZW50UGxhdGZvcm0uZGVsZXRlUHJvdGVjdGVkRmlsZXMoZ2V0TGVnYWN5Q29uZmlnRGlyKCkpO1xufSJdfQ==

@@ -8,3 +8,3 @@ /**

*/
export default function generateDomainCertificate(domain: string): Promise<void>;
export default function generateDomainCertificate(domains: string[]): Promise<void>;
export declare function generateKey(filename: string): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateKey = void 0;
const tslib_1 = require("tslib");

@@ -8,5 +9,5 @@ // import path from 'path';

const fs_1 = require("fs");
const constants_1 = require("./constants");
const utils_1 = require("./utils");
const certificate_authority_1 = require("./certificate-authority");
const constants_1 = require("./constants");
const debug = debug_1.default('devcert:certificates');

@@ -20,17 +21,18 @@ /**

*/
function generateDomainCertificate(domain) {
function generateDomainCertificate(domains) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
mkdirp_1.sync(constants_1.pathForDomain(domain));
debug(`Generating private key for ${domain}`);
let domainKeyPath = constants_1.pathForDomain(domain, 'private-key.key');
const domainPath = constants_1.getStableDomainPath(domains);
mkdirp_1.sync(constants_1.pathForDomain(domainPath));
debug(`Generating private key for ${domains}`);
let domainKeyPath = constants_1.pathForDomain(domainPath, 'private-key.key');
generateKey(domainKeyPath);
debug(`Generating certificate signing request for ${domain}`);
let csrFile = constants_1.pathForDomain(domain, `certificate-signing-request.csr`);
constants_1.withDomainSigningRequestConfig(domain, (configpath) => {
debug(`Generating certificate signing request for ${domains}`);
let csrFile = constants_1.pathForDomain(domainPath, `certificate-signing-request.csr`);
constants_1.withDomainSigningRequestConfig(domains, (configpath) => {
utils_1.openssl(['req', '-new', '-config', configpath, '-key', domainKeyPath, '-out', csrFile]);
});
debug(`Generating certificate for ${domain} from signing request and signing with root CA`);
let domainCertPath = constants_1.pathForDomain(domain, `certificate.crt`);
debug(`Generating certificate for ${domains} from signing request and signing with root CA`);
let domainCertPath = constants_1.pathForDomain(domainPath, `certificate.crt`);
yield certificate_authority_1.withCertificateAuthorityCredentials(({ caKeyPath, caCertPath }) => {
constants_1.withDomainCertificateConfig(domain, (domainCertConfigPath) => {
constants_1.withDomainCertificateConfig(domains, (domainCertConfigPath) => {
utils_1.openssl(['ca', '-config', domainCertConfigPath, '-in', csrFile, '-out', domainCertPath, '-keyfile', caKeyPath, '-cert', caCertPath, '-days', '825', '-batch']);

@@ -49,2 +51,2 @@ });

exports.generateKey = generateKey;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VydGlmaWNhdGVzLmpzIiwic291cmNlUm9vdCI6Ii9Vc2Vycy9qemV0bGVuL2dpdHMvZGV2Y2VydC8iLCJzb3VyY2VzIjpbImNlcnRpZmljYXRlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwyQkFBMkI7QUFDM0IsMERBQWdDO0FBQ2hDLG1DQUF3QztBQUN4QywyQkFBd0M7QUFDeEMsMkNBQXlHO0FBQ3pHLG1DQUFrQztBQUNsQyxtRUFBOEU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GUgZm9yICR7ZG9tYWluc30gZnJvbSBzaWduaW5nIHJlcXVlc3QgYW5kIHNpZ25pbmcgd2l0aCByb290IENBYCk7XG4gIGxldCBkb21haW5DZXJ0UGF0aCA9IHBhdGhGb3JEb21haW4oZG9tYWluUGF0aCwgYGNlcnRpZmljYXRlLmNydGApO1xuXG4gIGF3YWl0IHdpdGhDZXJ0aWZpY2F0ZUF1dGhvcml0eUNyZWRlbnRpYWxzKCh7Y2FLZXlQYXRoLCBjYUNlcnRQYXRofSkgPT4ge1xuICAgIHdpdGhEb21haW5DZXJ0aWZpY2F0ZUNvbmZpZyhkb21haW5zLCAoZG9tYWluQ2VydENvbmZpZ1BhdGgpID0+IHtcbiAgICAgIG9wZW5zc2woWydjYScsICctY29uZmlnJywgZG9tYWluQ2VydENvbmZpZ1BhdGgsICctaW4nLCBjc3JGaWxlLCAnLW91dCcsIGRvbWFpbkNlcnRQYXRoLCAnLWtleWZpbGUnLCBjYUtleVBhdGgsICctY2VydCcsIGNhQ2VydFBhdGgsICctZGF5cycsICc4MjUnLCAnLWJhdGNoJ10pXG4gICAgfSk7XG4gIH0pO1xufVxuXG4vLyBHZW5lcmF0ZSBhIGNyeXB0b2dyYXBoaWMga2V5LCB1c2VkIHRvIHNpZ24gY2VydGlmaWNhdGVzIG9yIGNlcnRpZmljYXRlIHNpZ25pbmcgcmVxdWVzdHMuXG5leHBvcnQgZnVuY3Rpb24gZ2VuZXJhdGVLZXkoZmlsZW5hbWU6IHN0cmluZyk6IHZvaWQge1xuICBkZWJ1ZyhgZ2VuZXJhdGVLZXk6ICR7IGZpbGVuYW1lIH1gKTtcbiAgb3BlbnNzbChbJ2dlbnJzYScsICctb3V0JywgZmlsZW5hbWUsICcyMDQ4J10pO1xuICBjaG1vZChmaWxlbmFtZSwgNDAwKTtcbn0iXX0=

@@ -8,2 +8,3 @@ export declare const VALID_IP: RegExp;

export declare const configPath: (...pathSegments: string[]) => string;
export declare const getStableDomainPath: (domains: string[]) => string;
export declare const domainsDir: string;

@@ -15,4 +16,4 @@ export declare const pathForDomain: (domain: string, ...pathSegments: string[]) => string;

export declare const caSelfSignConfig: string;
export declare function withDomainSigningRequestConfig(domain: string, cb: (filepath: string) => void): void;
export declare function withDomainCertificateConfig(domain: string, cb: (filepath: string) => void): void;
export declare function withDomainSigningRequestConfig(domains: string[], cb: (filepath: string) => void): void;
export declare function withDomainCertificateConfig(domains: string[], cb: (filepath: string) => void): void;
export declare const rootCADir: string;

@@ -19,0 +20,0 @@ export declare const rootCAKeyPath: string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ensureConfigDirs = exports.getLegacyConfigDir = exports.rootCACertPath = exports.rootCAKeyPath = exports.rootCADir = exports.withDomainCertificateConfig = exports.withDomainSigningRequestConfig = exports.caSelfSignConfig = exports.opensslDatabaseFilePath = exports.opensslSerialFilePath = exports.caVersionFile = exports.pathForDomain = exports.domainsDir = exports.getStableDomainPath = exports.configPath = exports.configDir = exports.isWindows = exports.isLinux = exports.isMac = exports.VALID_DOMAIN = exports.VALID_IP = void 0;
const tslib_1 = require("tslib");

@@ -20,2 +21,22 @@ const path_1 = tslib_1.__importDefault(require("path"));

exports.configPath = path_1.default.join.bind(path_1.default, exports.configDir);
const getFilteredDomains = (domains) => Array.from(domains
.sort((a, b) => b.length - a.length)
.reduce((filteredList, domain) => Array.from(filteredList)
.reduce((matches, item) => {
if (item.indexOf(domain) > -1) {
matches.add(domain);
}
else if (domain.indexOf(item) === -1 && item.indexOf(domain) === -1) {
matches.add(item);
matches.add(domain);
}
else {
matches.add(item);
}
return matches;
}, new Set()), new Set([domains[0]]))).sort();
const getStableDomainPath = (domains) => domains.length === 1 ?
domains[0] :
'san-' + utils_1.numericHash(getFilteredDomains(domains).join(''));
exports.getStableDomainPath = getStableDomainPath;
exports.domainsDir = exports.configPath('domains');

@@ -27,7 +48,17 @@ exports.pathForDomain = path_1.default.join.bind(path_1.default, exports.domainsDir);

exports.caSelfSignConfig = path_1.default.join(__dirname, '../openssl-configurations/certificate-authority-self-signing.conf');
function withDomainSigningRequestConfig(domain, cb) {
function generateSubjectAltNames(domains) {
return domains
.reduce((dnsEntries, domain) => dnsEntries.concat([
`DNS.${dnsEntries.length + 1} = ${domain}`,
`DNS.${dnsEntries.length + 2} = *.${domain}`,
]), [])
.join("\r\n");
}
function withDomainSigningRequestConfig(domains, cb) {
const domain = domains[0];
const subjectAltNames = generateSubjectAltNames(domains);
let tmpFile = utils_1.mktmp();
let source = fs_1.readFileSync(path_1.default.join(__dirname, '../openssl-configurations/domain-certificate-signing-requests.conf'), 'utf-8');
let template = lodash_1.template(source);
let result = template({ domain });
let result = template({ domain, subjectAltNames });
fs_1.writeFileSync(tmpFile, eol_1.default.auto(result));

@@ -38,3 +69,5 @@ cb(tmpFile);

exports.withDomainSigningRequestConfig = withDomainSigningRequestConfig;
function withDomainCertificateConfig(domain, cb) {
function withDomainCertificateConfig(domains, cb) {
const domainPath = exports.getStableDomainPath(domains);
const subjectAltNames = generateSubjectAltNames(domains);
let tmpFile = utils_1.mktmp();

@@ -44,6 +77,6 @@ let source = fs_1.readFileSync(path_1.default.join(__dirname, '../openssl-configurations/domain-certificates.conf'), 'utf-8');

let result = template({
domain,
subjectAltNames,
serialFile: exports.opensslSerialFilePath,
databaseFile: exports.opensslDatabaseFilePath,
domainDir: exports.pathForDomain(domain)
domainDir: exports.pathForDomain(domainPath)
});

@@ -80,2 +113,2 @@ fs_1.writeFileSync(tmpFile, eol_1.default.auto(result));

ensureConfigDirs();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6Ii9Vc2Vycy9qemV0bGVuL2dpdHMvZGV2Y2VydC8iLCJzb3VyY2VzIjpbImNvbnN0YW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx3REFBd0I7QUFDeEIsMkJBQTRGO0FBQzVGLG1DQUF3QztBQUN4QyxtQ0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Zm9ybSA9PT0gJ3dpbjMyJztcblxuLy8gQ29tbW9uIHBhdGhzXG5leHBvcnQgY29uc3QgY29uZmlnRGlyID0gYXBwbGljYXRpb25Db25maWdQYXRoKCdkZXZjZXJ0Jyk7XG5leHBvcnQgY29uc3QgY29uZmlnUGF0aDogKC4uLnBhdGhTZWdtZW50czogc3RyaW5nW10pID0+IHN0cmluZyA9IHBhdGguam9pbi5iaW5kKHBhdGgsIGNvbmZpZ0Rpcik7XG5cbmNvbnN0IGdldEZpbHRlcmVkRG9tYWlucyA9IChkb21haW5zOiBzdHJpbmdbXSkgPT5cbiAgQXJyYXkuZnJvbShcbiAgICBkb21haW5zXG4gICAgICAuc29ydCgoYSwgYikgPT4gYi5sZW5ndGggLSBhLmxlbmd0aClcbiAgICAgIC5yZWR1Y2UoKGZpbHRlcmVkTGlzdCwgZG9tYWluKSA9PlxuICAgICAgICBBcnJheS5mcm9tKGZpbHRlcmVkTGlzdClcbiAgICAgICAgICAucmVkdWNlKChtYXRjaGVzLCBpdGVtKSA9PiB7XG4gICAgICAgICAgICBpZiAoaXRlbS5pbmRleE9mKGRvbWFpbikgPiAtMSkge1xuICAgICAgICAgICAgICBtYXRjaGVzLmFkZChkb21haW4pO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChkb21haW4uaW5kZXhPZihpdGVtKSA9PT0gLTEgJiYgaXRlbS5pbmRleE9mKGRvbWFpbikgPT09IC0xKSB7XG4gICAgICAgICAgICAgIG1hdGNoZXMuYWRkKGl0ZW0pO1xuICAgICAgICAgICAgICBtYXRjaGVzLmFkZChkb21haW4pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgbWF0Y2hlcy5hZGQoaXRlbSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBtYXRjaGVzO1xuICAgICAgICAgIH0sIG5ldyBTZXQoKVxuICAgICAgICAgICksIG5ldyBTZXQoW2RvbWFpbnNbMF1dKVxuICAgICAgKVxuICAp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N1cmVDb25maWdEaXJzKCk7XG4iXX0=

@@ -48,5 +48,5 @@ /// <reference types="node" />

*/
export declare function certificateFor<O extends Options>(domain: string, options?: O): Promise<IReturnData<O>>;
export declare function hasCertificateFor(domain: string): boolean;
export declare function certificateFor<O extends Options>(requestedDomains: string | string[], options?: O): Promise<IReturnData<O>>;
export declare function hasCertificateFor(requestedDomains: string | string[]): boolean;
export declare function configuredDomains(): string[];
export declare function removeDomain(domain: string): void;
export declare function removeDomain(requestedDomains: string | string[]): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeDomain = exports.configuredDomains = exports.hasCertificateFor = exports.certificateFor = exports.uninstall = void 0;
const tslib_1 = require("tslib");

@@ -11,3 +12,3 @@ const fs_1 = require("fs");

const certificate_authority_1 = tslib_1.__importStar(require("./certificate-authority"));
exports.uninstall = certificate_authority_1.uninstall;
Object.defineProperty(exports, "uninstall", { enumerable: true, get: function () { return certificate_authority_1.uninstall; } });
const certificates_1 = tslib_1.__importDefault(require("./certificates"));

@@ -34,11 +35,15 @@ const user_interface_1 = tslib_1.__importDefault(require("./user-interface"));

*/
function certificateFor(domain, options = {}) {
function certificateFor(requestedDomains, options = {}) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
if (constants_1.VALID_IP.test(domain)) {
const domains = Array.isArray(requestedDomains) ? requestedDomains : [requestedDomains];
if (domains.some((d) => constants_1.VALID_IP.test(d))) {
throw new Error('IP addresses are not supported currently');
}
if (!constants_1.VALID_DOMAIN.test(domain)) {
throw new Error(`"${domain}" is not a valid domain name.`);
}
debug(`Certificate requested for ${domain}. Skipping certutil install: ${Boolean(options.skipCertutilInstall)}. Skipping hosts file: ${Boolean(options.skipHostsFile)}`);
domains.forEach((domain) => {
if (!constants_1.VALID_DOMAIN.test(domain)) {
throw new Error(`"${domain}" is not a valid domain name.`);
}
});
const domainPath = constants_1.getStableDomainPath(domains);
debug(`Certificate requested for ${domains}. Skipping certutil install: ${Boolean(options.skipCertutilInstall)}. Skipping hosts file: ${Boolean(options.skipHostsFile)}`);
if (options.ui) {

@@ -53,4 +58,4 @@ Object.assign(user_interface_1.default, options.ui);

}
let domainKeyPath = constants_1.pathForDomain(domain, `private-key.key`);
let domainCertPath = constants_1.pathForDomain(domain, `certificate.crt`);
let domainKeyPath = constants_1.pathForDomain(domainPath, `private-key.key`);
let domainCertPath = constants_1.pathForDomain(domainPath, `certificate.crt`);
if (!fs_1.existsSync(constants_1.rootCAKeyPath)) {

@@ -64,8 +69,10 @@ debug('Root CA is not installed yet, so it must be our first run. Installing root CA ...');

}
if (!fs_1.existsSync(constants_1.pathForDomain(domain, `certificate.crt`))) {
debug(`Can't find certificate file for ${domain}, so it must be the first request for ${domain}. Generating and caching ...`);
yield certificates_1.default(domain);
if (!fs_1.existsSync(constants_1.pathForDomain(domainPath, `certificate.crt`))) {
debug(`Can't find certificate file for ${domains}, so it must be the first request for ${domains}. Generating and caching ...`);
yield certificates_1.default(domains);
}
if (!options.skipHostsFile) {
yield platforms_1.default.addDomainToHostFileIfMissing(domain);
domains.forEach((domain) => tslib_1.__awaiter(this, void 0, void 0, function* () {
yield platforms_1.default.addDomainToHostFileIfMissing(domain);
}));
}

@@ -85,4 +92,6 @@ debug(`Returning domain certificate`);

exports.certificateFor = certificateFor;
function hasCertificateFor(domain) {
return fs_1.existsSync(constants_1.pathForDomain(domain, `certificate.crt`));
function hasCertificateFor(requestedDomains) {
const domains = Array.isArray(requestedDomains) ? requestedDomains : [requestedDomains];
const domainPath = constants_1.getStableDomainPath(domains);
return fs_1.existsSync(constants_1.pathForDomain(domainPath, `certificate.crt`));
}

@@ -94,6 +103,8 @@ exports.hasCertificateFor = hasCertificateFor;

exports.configuredDomains = configuredDomains;
function removeDomain(domain) {
return rimraf_1.default.sync(constants_1.pathForDomain(domain));
function removeDomain(requestedDomains) {
const domains = Array.isArray(requestedDomains) ? requestedDomains : [requestedDomains];
const domainPath = constants_1.getStableDomainPath(domains);
return rimraf_1.default.sync(constants_1.pathForDomain(dom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xuICAgIHJldHVybiAoYXdhaXQgcnVuKCdzdWRvJywgWydjYXQnLCBmaWxlcGF0aF0pKS50b1N0cmluZygpLnRyaW0oKTtcbiAgfVxuXG4gIGFzeW5jIHdyaXRlUHJvdGVjdGVkRmlsZShmaWxlcGF0aDogc3RyaW5nLCBjb250ZW50czogc3RyaW5nKSB7XG4gICAgYXNzZXJ0Tm90VG91Y2hpbmdGaWxlcyhmaWxlcGF0aCwgJ3dyaXRlJyk7XG4gICAgaWYgKGV4aXN0cyhmaWxlcGF0aCkpIHtcbiAgICAgIGF3YWl0IHJ1bignc3VkbycsIFsncm0nLCBmaWxlcGF0aF0pO1xuICAgIH1cbiAgICB3cml0ZUZpbGUoZmlsZXBhdGgsIGNvbnRlbnRzKTtcbiAgICBhd2FpdCBydW4oJ3N1ZG8nLCBbJ2Nob3duJywgJzAnLCBmaWxlcGF0aF0pO1xuICAgIGF3YWl0IHJ1bignc3VkbycsIFsnY2htb2QnLCAnNjAwJywgZmlsZXBhdGhdKTtcbiAgfVxuXG4gIHByaXZhdGUgaXNGaXJlZm94SW5zdGFsbGVkKCkge1xuICAgIHJldHVybiBleGlzdHModGhpcy5GSVJFRk9YX0JVTkRMRV9QQVRIKTtcbiAgfVxuXG4gIHByaXZhdGUgaXNOU1NJbnN0YWxsZWQoKSB7XG4gICAgdHJ5IHtcbiAgICAgIHJldHVybiBydW4oJ2JyZXcnLCBbJ2xpc3QnLCAnLTEnXSkudG9TdHJpbmcoKS5pbmNsdWRlcygnXFxubnNzXFxuJyk7XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG59O1xuIl19

@@ -5,2 +5,2 @@ "use strict";

exports.default = new PlatformClass();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiL1VzZXJzL2p6ZXRsZW4vZ2l0cy9kZXZjZXJ0LyIsInNvdX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XRoXSk7XG4gIH1cblxuICBhc3luYyByZWFkUHJvdGVjdGVkRmlsZShmaWxlcGF0aDogc3RyaW5nKSB7XG4gICAgYXNzZXJ0Tm90VG91Y2hpbmdGaWxlcyhmaWxlcGF0aCwgJ3JlYWQnKTtcbiAgICByZXR1cm4gKGF3YWl0IHJ1bignc3VkbycsIFsnY2F0JywgZmlsZXBhdGhdKSkudG9TdHJpbmcoKS50cmltKCk7XG4gIH1cblxuICBhc3luYyB3cml0ZVByb3RlY3RlZEZpbGUoZmlsZXBhdGg6IHN0cmluZywgY29udGVudHM6IHN0cmluZykge1xuICAgIGFzc2VydE5vdFRvdWNoaW5nRmlsZXMoZmlsZXBhdGgsICd3cml0ZScpO1xuICAgIGlmIChleGlzdHMoZmlsZXBhdGgpKSB7XG4gICAgICBhd2FpdCBydW4oJ3N1ZG8nLCBbJ3JtJywgZmlsZXBhdGhdKTtcbiAgICB9XG4gICAgd3JpdGVGaWxlKGZpbGVwYXRoLCBjb250ZW50cyk7XG4gICAgYXdhaXQgcnVuKCdzdWRvJywgWydjaG93bicsICcwJywgZmlsZXBhdGhdKTtcbiAgICBhd2FpdCBydW4oJ3N1ZG8nLCBbJ2NobW9kJywgJzYwMCcsIGZpbGVwYXRoXSk7XG4gIH1cblxuICBwcml2YXRlIGlzRmlyZWZveEluc3RhbGxlZCgpIHtcbiAgICByZXR1cm4gZXhpc3RzKHRoaXMuRklSRUZPWF9CSU5fUEFUSCk7XG4gIH1cblxuICBwcml2YXRlIGlzQ2hyb21lSW5zdGFsbGVkKCkge1xuICAgIHJldHVybiBleGlzdHModGhpcy5DSFJPTUVfQklOX1BBVEgpO1xuICB9XG5cbn0iXX0=
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertNotTouchingFiles = exports.openCertificateInFirefox = exports.closeFirefox = exports.removeCertificateFromNSSCertDB = exports.addCertificateToNSSCertDB = void 0;
const tslib_1 = require("tslib");

@@ -144,2 +145,2 @@ const path_1 = tslib_1.__importDefault(require("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1cbiAgICBsZXQgZW5jcnlwdGVkQ29udGVudHMgPSB0aGlzLmVuY3J5cHQoY29udGVudHMsIGVuY3J5cHRpb25LZXkpO1xuICAgIHdyaXRlKGZpbGVwYXRoLCBlbmNyeXB0ZWRDb250ZW50cyk7XG4gIH1cblxuICBwcml2YXRlIGVuY3J5cHQodGV4dDogc3RyaW5nLCBrZXk6IHN0cmluZykge1xuICAgIGxldCBjaXBoZXIgPSBjcnlwdG8uY3JlYXRlQ2lwaGVyKCdhZXMyNTYnLCBuZXcgQnVmZmVyKGtleSkpO1xuICAgIHJldHVybiBjaXBoZXIudXBkYXRlKHRleHQsICd1dGY4JywgJ2hleCcpICsgY2lwaGVyLmZpbmFsKCdoZXgnKTtcbiAgfVxuXG4gIHByaXZhdGUgZGVjcnlwdChlbmNyeXB0ZWQ6IHN0cmluZywga2V5OiBzdHJpbmcpIHtcbiAgICBsZXQgZGVjaXBoZXIgPSBjcnlwdG8uY3JlYXRlRGVjaXBoZXIoJ2FlczI1NicsIG5ldyBCdWZmZXIoa2V5KSk7XG4gICAgcmV0dXJuIGRlY2lwaGVyLnVwZGF0ZShlbmNyeXB0ZWQsICdoZXgnLCAndXRmOCcpICsgZGVjaXBoZXIuZmluYWwoJ3V0ZjgnKTtcbiAgfVxuXG59Il19

@@ -76,2 +76,2 @@ "use strict";

exports.default = DefaultUI;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci1pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiL1VzZXJzL2p6ZXRsZW4vZ2l0cy9kZXZjZXJ0LyIsInNvdXJjZXMiOlsidXNlci1pbnRlcmZhY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsOEVBQTZDO0FBQzdDLG1DQUFzQztBQVd0QyxNQUFNLFNBQVMsR0FBa0I7SUFDekIsNEJBQTRCOztZQUNoQyxPQUFPLE1BQU0seUJBQWMsQ0FBQywwREFBMEQsQ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2sgb3V0XG4gICAgICBodHRwczovL2dpdGh1Yi5jb20vZGF2ZXdhc21lci9kZXZjZXJ0I2hvdy1pdC13b3Jrc1xuXG4gICAgICA8UHJlc3MgYW55IGtleSB0byBsYXVuY2ggRmlyZWZveCB3aXphcmQ+XG4gICAgYCk7XG4gICAgYXdhaXQgd2FpdEZvclVzZXIoKTtcbiAgfSxcbiAgYXN5bmMgZmlyZWZveFdpemFyZFByb21wdFBhZ2UoY2VydGlmaWNhdGVVUkw6IHN0cmluZykge1xuICAgIHJldHVybiBgXG4gICAgICA8aHRtbD5cbiAgICAgICAgPGhlYWQ+XG4gICAgICAgICAgPG1ldGEgaHR0cC1lcXVpdj1cInJlZnJlc2hcIiBjb250ZW50PVwiMDsgdXJsPSR7Y2VydGlmaWNhdGVVUkx9XCIgLz5cbiAgICAgICAgPC9oZWFkPlxuICAgICAgPC9odG1sPlxuICAgIGA7XG4gIH0sXG4gIGFzeW5jIHdhaXRGb3JGaXJlZm94V2l6YXJkKCkge1xuICAgIGNvbnNvbGUubG9nKGBcbiAgICAgIExhdW5jaGluZyBGaXJlZm94IC4uLlxuXG4gICAgICBHcmVhdCEgT25jZSB5b3UndmUgZmluaXNoZWQgdGhlIEZpcmVmb3ggd2l6YXJkIGZvciBhZGRpbmcgdGhlIGRldmNlcnRcbiAgICAgIGNlcnRpZmljYXRlLCBqdXN0IGhpdCBhbnkga2V5IGhlcmUgYWdhaW4gYW5kIHdlJ2xsIHdyYXAgdXAuXG5cbiAgICAgIDxQcmVzcyBhbnkga2V5IHRvIGNvbnRpbnVlPlxuICAgIGApXG4gICAgYXdhaXQgd2FpdEZvclVzZXIoKTtcbiAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBEZWZhdWx0VUk7Il19

@@ -6,5 +6,6 @@ /// <reference types="node" />

export declare function sudoAppend(file: string, input: ExecFileSyncOptions["input"]): void;
export declare function waitForUser(): Promise<{}>;
export declare function waitForUser(): Promise<unknown>;
export declare function reportableError(message: string): Error;
export declare function mktmp(): string;
export declare function sudo(cmd: string): Promise<string | null>;
export declare const numericHash: (str: string) => number;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.numericHash = exports.sudo = exports.mktmp = exports.reportableError = exports.waitForUser = exports.sudoAppend = exports.run = exports.openssl = void 0;
const tslib_1 = require("tslib");

@@ -57,2 +58,11 @@ const child_process_1 = require("child_process");

exports.sudo = sudo;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiL1VzZXJzL2p6ZXRsZW4vZ2l0cy9kZXZjZXJ0LyIsInNvdXJjZXMiOlsidXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsaURBQWtFO0FBQ2xFLHNEQUFzQjtBQUN0QiwwREFBZ0M7QUFDaEMsd0RBQXdCO0FBQ3hCLHNFQUFxQztBQUVyQywyQ0FBeUM7QUFFekMsTUFBTSxLQUFLLEdBQUcsZUFBVyxDQUFDLGNBQWMsQ0FBQyxDQUFDO0FBRTFDLGlCQUF3QixJQUFjO0lBQ3BDLE9BQU8sR0FBRyxDQUFDLFNBQVMsRUFBRSxJQUFJLEVBQUU7UUFDMUIsS0FBSyxFQUFFLE1BQU07UUFDYixHQUFHLEVBQUUsTUFBTSxDQUFDLE1BQU0sQ0FBQztZQUNqQixRQUFRLEVBQUUsY0FBSSxDQUFDLElBQUksQ0FBQyxzQkFBVSxDQUFDLE1BQU0sQ0FBQyxDQUFDO1NBQ3hDLEVBQUUsT0FBTyxDQUFDLEdBQUcsQ0FBQztLQUNoQixDQUFDLENBQUM7QUFDTCxDQUFDO0FBUEQsMEJBT0M7QUFFRCxhQUFvQixHQUFXLEVBQUUsSUFBYyxFQUFFLFVBQStCLEVBQUU7SUFDaEYsS0FBSyxDQUFDLG1CQUFvQixHQUFJLElBQUksSUFBSSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLENBQU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cyBpbiB1c2UgaWYgd2UgY3JlYXRlIGEgdG1wIGZpbGVcbiAgLy8gYW5kIHRoZW4gc2hlbGwgb3V0IHRvIGEgcHJvY2VzcyB0aGF0IHRyaWVzIHRvIHVzZSBpdFxuICByZXR1cm4gdG1wLmZpbGVTeW5jKHsgZGlzY2FyZERlc2NyaXB0b3I6IHRydWUgfSkubmFtZTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHN1ZG8oY21kOiBzdHJpbmcpOiBQcm9taXNlPHN0cmluZyB8IG51bGw+IHtcbiAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICBzdWRvUHJvbXB0LmV4ZWMoY21kLCB7IG5hbWU6ICdkZXZjZXJ0JyB9LCAoZXJyOiBFcnJvciB8IG51bGwsIHN0ZG91dDogc3RyaW5nIHwgbnVsbCwgc3RkZXJyOiBzdHJpbmcgfCBudWxsKSA9PiB7XG4gICAgICBsZXQgZXJyb3IgPSBlcnIgfHwgKHR5cGVvZiBzdGRlcnIgPT09ICdzdHJpbmcnICYmIHN0ZGVyci50cmltKCkubGVuZ3RoID4gMCAmJiBuZXcgRXJyb3Ioc3RkZXJyKSkgO1xuICAgICAgZXJyb3IgPyByZWplY3QoZXJyb3IpIDogcmVzb2x2ZShzdGRvdXQpO1xuICAgIH0pO1xuICB9KTtcbn1cbiJdfQ==
const numericHash = (str) => {
let hash = 5381;
let i = str.length;
while (i) {
hash = hash * 33 ^ str.charCodeAt(--i);
}
return hash >>> 0;
};
exports.numericHash = numericHash;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiLi8iLCJzb3VyY2VzIjpbInV0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxpREFBa0U7QUFDbEUsc0RBQXNCO0FBQ3RCLDBEQUFnQztBQUNoQyx3REFBd0I7QUFDeEI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3JlYXRlIGEgdG1wIGZpbGVcbiAgLy8gYW5kIHRoZW4gc2hlbGwgb3V0IHRvIGEgcHJvY2VzcyB0aGF0IHRyaWVzIHRvIHVzZSBpdFxuICByZXR1cm4gdG1wLmZpbGVTeW5jKHsgZGlzY2FyZERlc2NyaXB0b3I6IHRydWUgfSkubmFtZTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHN1ZG8oY21kOiBzdHJpbmcpOiBQcm9taXNlPHN0cmluZyB8IG51bGw+IHtcbiAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICBzdWRvUHJvbXB0LmV4ZWMoY21kLCB7IG5hbWU6ICdkZXZjZXJ0JyB9LCAoZXJyOiBFcnJvciB8IG51bGwsIHN0ZG91dDogc3RyaW5nIHwgbnVsbCwgc3RkZXJyOiBzdHJpbmcgfCBudWxsKSA9PiB7XG4gICAgICBsZXQgZXJyb3IgPSBlcnIgfHwgKHR5cGVvZiBzdGRlcnIgPT09ICdzdHJpbmcnICYmIHN0ZGVyci50cmltKCkubGVuZ3RoID4gMCAmJiBuZXcgRXJyb3Ioc3RkZXJyKSkgO1xuICAgICAgZXJyb3IgPyByZWplY3QoZXJyb3IpIDogcmVzb2x2ZShzdGRvdXQpO1xuICAgIH0pO1xuICB9KTtcbn1cblxuZXhwb3J0IGNvbnN0IG51bWVyaWNIYXNoID0gKHN0cjogc3RyaW5nKTogbnVtYmVyID0+IHtcbiAgbGV0IGhhc2ggPSA1MzgxO1xuICBsZXQgaSA9IHN0ci5sZW5ndGg7XG5cbiAgd2hpbGUgKGkpIHtcbiAgICBoYXNoID0gaGFzaCAqIDMzIF4gc3RyLmNoYXJDb2RlQXQoLS1pKTtcbiAgfVxuXG4gIHJldHVybiBoYXNoID4+PiAwO1xufTsiXX0=
{
"name": "devcert",
"version": "1.1.3",
"version": "1.2.0",
"description": "Generate trusted local SSL/TLS certificates for local SSL development",

@@ -30,3 +30,3 @@ "main": "dist/index.js",

"standard-version": "^8.0.1",
"typescript": "^2.9.2"
"typescript": "4.3.2"
},

@@ -33,0 +33,0 @@ "dependencies": {

@@ -100,2 +100,94 @@ # devcert - Development SSL made easy

## Multiple domains (SAN)
If you are developing a multi-tenant app or have many apps locally, you can generate a security
certificate using `devcert` to also use the [Subject Alternative Name](https://en.wikipedia.org/wiki/Subject_Alternative_Name)
extension, just pass an array of domains instead.
```js
let ssl = await devcert.certificateFor([
'localhost',
'local.api.example.com',
'local.example.com',
'local.auth.example.com'
]);
https.createServer(ssl, app).listen(3000);
```
## Docker and local development
If you are developing with Docker, one option is to install `devcert` into a base folder in your home directory and
generate certificates for all of your local Docker projects. See comments and caveats in [this issue](https://github.com/davewasmer/devcert/issues/17).
While not elegant, you only really need to do this as often as you add new domains locally, which is probably not very often.
The general script would look something like:
```js
// example: make a directory in home directory such as ~/devcert-util
// ~/devcert-util/generate.js
const fs = require('fs');
const devcert = require('devcert');
// or if its just one domain - devcert.certificateFor('local.example.com')
devcert.certificateFor([
'localhost',
'local.api.example.com',
'local.example.com',
'local.auth.example.com'
])
.then(({key, cert}) => {
fs.writeFileSync('./certs/tls.key', key);
fs.writeFileSync('./certs/tls.cert', cert);
})
.catch(console.error);
```
An easy way to use the files generated from above script is to copy the `~/devcert-util/certs` folder into your Docker projects:
```
# local-docker-project-root/
🗀 certs/
🗎 tls.key
🗎 tls.cert
```
And add this line to your `.gitignore`:
```
certs/
```
These two files can now easily be used by any project, be it Node.js or something else.
In Node, within Docker, simply load the copied certificate files into your https server:
```js
const fs = require('fs');
const Express = require('express');
const app = new Express();
https
.createServer({
key: fs.readFileSync('./certs/tls.key'),
cert: fs.readFileSync('./certs/tls.cert')
}, app)
.listen(3000);
```
Also works with webpack dev server or similar technologies:
```js
// webpack.config.js
const fs = require('fs');
module.exports = {
//...
devServer: {
contentBase: join(__dirname, 'dist'),
host: '0.0.0.0',
public: 'local.api.example.com',
port: 3000,
publicPath: '/',
https: {
key: fs.readFileSync('./certs/tls.key'),
cert: fs.readFileSync('./certs/tls.cert')
}
}
};
```
## How it works

@@ -102,0 +194,0 @@

@@ -5,5 +5,5 @@ // import path from 'path';

import { chmodSync as chmod } from 'fs';
import { pathForDomain, withDomainSigningRequestConfig, withDomainCertificateConfig } from './constants';
import { openssl } from './utils';
import { withCertificateAuthorityCredentials } from './certificate-authority';
import {pathForDomain, getStableDomainPath, withDomainSigningRequestConfig, withDomainCertificateConfig} from './constants';

@@ -19,20 +19,21 @@ const debug = createDebug('devcert:certificates');

*/
export default async function generateDomainCertificate(domain: string): Promise<void> {
mkdirp(pathForDomain(domain));
export default async function generateDomainCertificate(domains: string[]): Promise<void> {
const domainPath = getStableDomainPath(domains);
mkdirp(pathForDomain(domainPath));
debug(`Generating private key for ${ domain }`);
let domainKeyPath = pathForDomain(domain, 'private-key.key');
debug(`Generating private key for ${domains}`);
let domainKeyPath = pathForDomain(domainPath, 'private-key.key');
generateKey(domainKeyPath);
debug(`Generating certificate signing request for ${ domain }`);
let csrFile = pathForDomain(domain, `certificate-signing-request.csr`);
withDomainSigningRequestConfig(domain, (configpath) => {
debug(`Generating certificate signing request for ${domains}`);
let csrFile = pathForDomain(domainPath, `certificate-signing-request.csr`);
withDomainSigningRequestConfig(domains, (configpath) => {
openssl(['req', '-new', '-config', configpath, '-key', domainKeyPath, '-out', csrFile]);
});
debug(`Generating certificate for ${ domain } from signing request and signing with root CA`);
let domainCertPath = pathForDomain(domain, `certificate.crt`);
debug(`Generating certificate for ${domains} from signing request and signing with root CA`);
let domainCertPath = pathForDomain(domainPath, `certificate.crt`);
await withCertificateAuthorityCredentials(({ caKeyPath, caCertPath }) => {
withDomainCertificateConfig(domain, (domainCertConfigPath) => {
await withCertificateAuthorityCredentials(({caKeyPath, caCertPath}) => {
withDomainCertificateConfig(domains, (domainCertConfigPath) => {
openssl(['ca', '-config', domainCertConfigPath, '-in', csrFile, '-out', domainCertPath, '-keyfile', caKeyPath, '-cert', caCertPath, '-days', '825', '-batch'])

@@ -39,0 +40,0 @@ });

@@ -7,3 +7,3 @@ import path from 'path';

import eol from 'eol';
import { mktmp } from './utils';
import {mktmp, numericHash} from './utils';

@@ -22,2 +22,28 @@ export const VALID_IP = /(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}/;

const getFilteredDomains = (domains: string[]) =>
Array.from(
domains
.sort((a, b) => b.length - a.length)
.reduce((filteredList, domain) =>
Array.from(filteredList)
.reduce((matches, item) => {
if (item.indexOf(domain) > -1) {
matches.add(domain);
} else if (domain.indexOf(item) === -1 && item.indexOf(domain) === -1) {
matches.add(item);
matches.add(domain);
} else {
matches.add(item);
}
return matches;
}, new Set()
), new Set([domains[0]])
)
).sort();
export const getStableDomainPath = (domains: string[]) =>
domains.length === 1 ?
domains[0] :
'san-' + numericHash(getFilteredDomains(domains).join(''));
export const domainsDir = configPath('domains');

@@ -31,7 +57,19 @@ export const pathForDomain: (domain: string, ...pathSegments: string[]) => string = path.join.bind(path, domainsDir)

export function withDomainSigningRequestConfig(domain: string, cb: (filepath: string) => void) {
function generateSubjectAltNames(domains: string[]): string {
return domains
.reduce((dnsEntries, domain) =>
dnsEntries.concat([
`DNS.${dnsEntries.length + 1} = ${domain}`,
`DNS.${dnsEntries.length + 2} = *.${domain}`,
]), [] as string[])
.join("\r\n");
}
export function withDomainSigningRequestConfig(domains: string[], cb: (filepath: string) => void) {
const domain = domains[0];
const subjectAltNames = generateSubjectAltNames(domains);
let tmpFile = mktmp();
let source = readFile(path.join(__dirname, '../openssl-configurations/domain-certificate-signing-requests.conf'), 'utf-8');
let template = makeTemplate(source);
let result = template({ domain });
let result = template({domain, subjectAltNames});
writeFile(tmpFile, eol.auto(result));

@@ -42,3 +80,5 @@ cb(tmpFile);

export function withDomainCertificateConfig(domain: string, cb: (filepath: string) => void) {
export function withDomainCertificateConfig(domains: string[], cb: (filepath: string) => void) {
const domainPath = getStableDomainPath(domains);
const subjectAltNames = generateSubjectAltNames(domains);
let tmpFile = mktmp();

@@ -48,6 +88,6 @@ let source = readFile(path.join(__dirname, '../openssl-configurations/domain-certificates.conf'), 'utf-8');

let result = template({
domain,
subjectAltNames,
serialFile: opensslSerialFilePath,
databaseFile: opensslDatabaseFilePath,
domainDir: pathForDomain(domain)
domainDir: pathForDomain(domainPath)
});

@@ -54,0 +94,0 @@ writeFile(tmpFile, eol.auto(result));

@@ -10,2 +10,3 @@ import { readFileSync as readFile, readdirSync as readdir, existsSync as exists } from 'fs';

pathForDomain,
getStableDomainPath,
domainsDir,

@@ -25,3 +26,3 @@ rootCAKeyPath,

export interface Options /* extends Partial<ICaBufferOpts & ICaPathOpts> */{
export interface Options /* extends Partial<ICaBufferOpts & ICaPathOpts> */ {
/** Return the CA certificate data? */

@@ -71,11 +72,16 @@ getCaBuffer?: boolean;

*/
export async function certificateFor<O extends Options>(domain: string, options: O = {} as O): Promise<IReturnData<O>> {
if (VALID_IP.test(domain)) {
export async function certificateFor<O extends Options>(requestedDomains: string | string[], options: O = {} as O): Promise<IReturnData<O>> {
const domains = Array.isArray(requestedDomains) ? requestedDomains : [requestedDomains];
if (domains.some((d) => VALID_IP.test(d))) {
throw new Error('IP addresses are not supported currently');
}
if (!VALID_DOMAIN.test(domain)) {
throw new Error(`"${domain}" is not a valid domain name.`);
}
debug(`Certificate requested for ${ domain }. Skipping certutil install: ${ Boolean(options.skipCertutilInstall) }. Skipping hosts file: ${ Boolean(options.skipHostsFile) }`);
domains.forEach((domain) => {
if (!VALID_DOMAIN.test(domain)) {
throw new Error(`"${domain}" is not a valid domain name.`);
}
});
const domainPath = getStableDomainPath(domains);
debug(`Certificate requested for ${domains}. Skipping certutil install: ${Boolean(options.skipCertutilInstall)}. Skipping hosts file: ${Boolean(options.skipHostsFile)}`);
if (options.ui) {

@@ -86,3 +92,3 @@ Object.assign(UI, options.ui);

if (!isMac && !isLinux && !isWindows) {
throw new Error(`Platform not supported: "${ process.platform }"`);
throw new Error(`Platform not supported: "${process.platform}"`);
}

@@ -94,4 +100,4 @@

let domainKeyPath = pathForDomain(domain, `private-key.key`);
let domainCertPath = pathForDomain(domain, `certificate.crt`);
let domainKeyPath = pathForDomain(domainPath, `private-key.key`);
let domainCertPath = pathForDomain(domainPath, `certificate.crt`);

@@ -106,9 +112,11 @@ if (!exists(rootCAKeyPath)) {

if (!exists(pathForDomain(domain, `certificate.crt`))) {
debug(`Can't find certificate file for ${ domain }, so it must be the first request for ${ domain }. Generating and caching ...`);
await generateDomainCertificate(domain);
if (!exists(pathForDomain(domainPath, `certificate.crt`))) {
debug(`Can't find certificate file for ${domains}, so it must be the first request for ${domains}. Generating and caching ...`);
await generateDomainCertificate(domains);
}
if (!options.skipHostsFile) {
await currentPlatform.addDomainToHostFileIfMissing(domain);
domains.forEach(async (domain) => {
await currentPlatform.addDomainToHostFileIfMissing(domain);
})
}

@@ -122,4 +130,4 @@

} as IReturnData<O>;
if (options.getCaBuffer) (ret as ICaBuffer).ca = readFile(rootCACertPath);
if (options.getCaPath) (ret as ICaPath).caPath = rootCACertPath;
if (options.getCaBuffer) (ret as unknown as ICaBuffer).ca = readFile(rootCACertPath);
if (options.getCaPath) (ret as unknown as ICaPath).caPath = rootCACertPath;

@@ -129,4 +137,6 @@ return ret;

export function hasCertificateFor(domain: string) {
return exists(pathForDomain(domain, `certificate.crt`));
export function hasCertificateFor(requestedDomains: string | string[]) {
const domains = Array.isArray(requestedDomains) ? requestedDomains : [requestedDomains];
const domainPath = getStableDomainPath(domains);
return exists(pathForDomain(domainPath, `certificate.crt`));
}

@@ -138,4 +148,6 @@

export function removeDomain(domain: string) {
return rimraf.sync(pathForDomain(domain));
export function removeDomain(requestedDomains: string | string[]) {
const domains = Array.isArray(requestedDomains) ? requestedDomains : [requestedDomains];
const domainPath = getStableDomainPath(domains);
return rimraf.sync(pathForDomain(domainPath));
}

@@ -56,1 +56,12 @@ import { execFileSync, ExecFileSyncOptions } from 'child_process';

}
export const numericHash = (str: string): number => {
let hash = 5381;
let i = str.length;
while (i) {
hash = hash * 33 ^ str.charCodeAt(--i);
}
return hash >>> 0;
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc