New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mkcert

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkcert - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

13

package.json
{
"name": "mkcert",
"version": "1.4.0",
"version": "1.5.0",
"description": "Create Self Signed Development Certificates",

@@ -13,3 +13,3 @@ "main": "src/mkcert.js",

"engines": {
"node": ">=8"
"node": ">=12"
},

@@ -37,10 +37,9 @@ "jest": {

"dependencies": {
"commander": "^6.1.0",
"is-ip": "^3.1.0",
"node-forge": "^0.10.0",
"random-int": "^2.0.1"
"commander": "^8.3.0",
"ip-regex": "^4.3.0",
"node-forge": "^1.2.1"
},
"devDependencies": {
"jest": "^26.4.2"
"jest": "^27.4.7"
}
}
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const program = require('commander');
const { program } = require('commander');
const mkcert = require('./mkcert');

@@ -73,8 +73,7 @@ const pkg = require('../package.json');

.option('--locality [value]', 'Locality address', 'San Francisco')
.option('--validity [days]', 'Validity in days', 365)
.option('--validity [days]', 'Validity in days', '365')
.option('--key [file]', 'Output key', 'ca.key')
.option('--cert [file]', 'Output certificate', 'ca.crt')
.action((...args)=> {
const options = args.reverse()[0];
createCA(options);
.action(async (options)=> {
await createCA(options);
});

@@ -87,15 +86,16 @@

.option('--ca-cert [file]', 'CA certificate', 'ca.crt')
.option('--validity [days]', 'Validity in days', 365)
.option('--validity [days]', 'Validity in days', '365')
.option('--key [file]', 'Output key', 'cert.key')
.option('--cert [file]', 'Output certificate', 'cert.crt')
.option('--domains [values]', 'Comma separated list of domains/ip addresses', 'localhost,127.0.0.1')
.action((...args)=> {
const options = args.reverse()[0];
createCert(options);
.action(async (options)=> {
await createCert(options);
});
program
.version(pkg.version)
.parse(process.argv);
(async () => {
await program
.version(pkg.version)
.parseAsync(process.argv);
if(process.argv.length < 3) program.outputHelp();
if(process.argv.length < 3) program.outputHelp();
})();

@@ -1,5 +0,4 @@

const isIp = require('is-ip');
const ipRegex = require('ip-regex');
const forge = require('node-forge');
const { promisify } = require('util');
const randomInt = require('random-int');
const pki = forge.pki;

@@ -9,3 +8,4 @@ const generateKeyPair = promisify(pki.rsa.generateKeyPair.bind(pki.rsa));

async function generateCert({ subject, issuer, extensions, validityDays, signWith }) {
const serial = randomInt(50000, 99999).toString();
// create serial from and integer between 50000 and 99999
const serial = Math.floor((Math.random() * 95000) + 50000).toString();
const keyPair = await generateKeyPair({ bits: 2048, workers: 4 });

@@ -70,3 +70,5 @@ const cert = pki.createCertificate();

const types = { domain: 2, ip: 7 }; // available Types: https://git.io/fptng
if(isIp(domain)) return { type: types.ip, ip: domain };
const isIp = ipRegex({ exact: true }).test(domain);
if(isIp) return { type: types.ip, ip: domain };
return { type: types.domain, value: domain };

@@ -73,0 +75,0 @@ })}

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