Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Subash/mkcert
Create self signed ssl certificates without OpenSSL.
https://github.com/Subash/mkcert
Last synced: 12 days ago
JSON representation
Create self signed ssl certificates without OpenSSL.
- Host: GitHub
- URL: https://github.com/Subash/mkcert
- Owner: Subash
- License: mit
- Created: 2018-11-10T05:47:43.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-11-07T14:04:49.000Z (about 1 year ago)
- Last Synced: 2024-10-15T12:46:03.448Z (28 days ago)
- Language: TypeScript
- Homepage:
- Size: 734 KB
- Stars: 138
- Watchers: 5
- Forks: 12
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
Create self signed tls certificates without OpenSSL.
## Install
```
npm install -g mkcert
```## CLI
### Create a Certificate Authority
```
$ mkcert create-ca --helpOptions:
--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 file (default: "ca.key")
--cert [file] output certificate file (default: "ca.crt")
-h, --help display help for command
```### Create a Certificate
```
$ mkcert create-cert --helpOptions:
--ca-key [file] ca private key file (default: "ca.key")
--ca-cert [file] ca certificate file (default: "ca.crt")
--validity [days] validity in days (default: 365)
--key [file] output key file (default: "cert.key")
--cert [file] output certificate file (default: "cert.crt")
--organization [value] optional organization name
--email [value] optional email address
--domains, --domain [values...] domains or ip addresses (default: ["localhost","127.0.0.1"])
-h, --help display help for command
```## API
```js
import { createCA, createCert } from "mkcert";const ca = await createCA({
organization: "Hello CA",
countryCode: "NP",
state: "Bagmati",
locality: "Kathmandu",
validity: 365
});const cert = await createCert({
ca: { key: ca.key, cert: ca.cert },
domains: ["127.0.0.1", "localhost"],
validity: 365
});console.log(cert.key, cert.cert); // certificate info
console.log(`${cert.cert}${ca.cert}`); // create full chain certificate by merging CA and domain certificates
```