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

Create Self Signed Development Certificates

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
64K
increased by0.26%
Maintainers
1
Weekly downloads
 
Created
Source

Create self signed ssl certificates without OpenSSL.

Install

npm install -g mkcert

CLI

Create a Certificate Authority

$ mkcert create-ca --help

  Usage: create-ca [options]

  Options:
    --organization [value]  Organization name (default: "Test CA")
    --country-code [value]  Country code (default: "US")
    --state [value]         State name (default: "California")
    --locality [value]      Locality address (default: "San Francisco")
    --validity [days]       Validity in days (default: 365)
    --key [file]            Output key (default: "ca.key")
    --cert [file]           Output certificate (default: "ca.crt")
    -h, --help              output usage information

Create a Certificate

$ mkcert create-cert --help

  Usage: create-cert [options]

  Options:
    --ca-key [file]     CA private key (default: "ca.key")
    --ca-cert [file]    CA certificate (default: "ca.crt")
    --validity [days]   Validity in days (default: 365)
    --key [file]        Output key (default: "cert.key")
    --cert [file]       Output certificate (default: "cert.crt")
    --domains [values]  Comma separated list of domains/ip addresses (default: "localhost,127.0.0.1")
    -h, --help          output usage information

API

Create a Certificate Authority

import * as mkcert from 'mkcert';

//Create a Certificate Authority
mkcert.createCA({
  organization: 'Hello CA',
  countryCode: 'NP',
  state: 'Bagmati',
  locality: 'Kathmandu',
  validityDays: 365
})
.then((ca)=> {
  console.log(ca.key, ca.cert);
})
.catch(err=> console.error(err));

Create a Certificate

import * as mkcert from 'mkcert';
//Create a CA first

//Then create the certificate
mkcert.createCert({
  domains: ['127.0.0.1', 'localhost'],
  validityDays: 365,
  caKey: ca.key,
  caCert: ca.cert
})
.then((cert)=> {
  console.log(cert.key, cert.cert);

  //Create a full chain certificate by merging CA and domain certificates
  console.log(`${cert.cert}\n${ca.cert}`);
})
.catch(err=> console.error(err));

Keywords

FAQs

Package last updated on 31 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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