{"id":15598903,"url":"https://github.com/lukechilds/create-cert","last_synced_at":"2025-04-14T19:07:55.472Z","repository":{"id":66309105,"uuid":"93224986","full_name":"lukechilds/create-cert","owner":"lukechilds","description":"Super simple self signed certificates","archived":false,"fork":false,"pushed_at":"2019-11-07T11:55:49.000Z","size":98,"stargazers_count":42,"open_issues_count":10,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T19:07:49.174Z","etag":null,"topics":["certificate","https","self-signed","self-signed-certificate","ssl","ssl-certificate","ssl-certificates"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukechilds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-03T05:09:25.000Z","updated_at":"2025-04-05T13:49:23.000Z","dependencies_parsed_at":"2023-03-07T13:30:28.927Z","dependency_job_id":null,"html_url":"https://github.com/lukechilds/create-cert","commit_stats":{"total_commits":52,"total_committers":2,"mean_commits":26.0,"dds":"0.17307692307692313","last_synced_commit":"7ff8cf3730c7c7a40df896f972e58336ac867ed0"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fcreate-cert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fcreate-cert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fcreate-cert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukechilds%2Fcreate-cert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukechilds","download_url":"https://codeload.github.com/lukechilds/create-cert/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248943456,"owners_count":21186958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["certificate","https","self-signed","self-signed-certificate","ssl","ssl-certificate","ssl-certificates"],"created_at":"2024-10-03T01:41:54.395Z","updated_at":"2025-04-14T19:07:55.448Z","avatar_url":"https://github.com/lukechilds.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# create-cert\n\n\u003e Super simple self signed certificates\n\n[![Build Status](https://travis-ci.org/lukechilds/create-cert.svg?branch=master)](https://travis-ci.org/lukechilds/create-cert)\n[![Coverage Status](https://coveralls.io/repos/github/lukechilds/create-cert/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/create-cert?branch=master)\n[![npm](https://img.shields.io/npm/dm/create-cert.svg)](https://www.npmjs.com/package/create-cert)\n[![npm](https://img.shields.io/npm/v/create-cert.svg)](https://www.npmjs.com/package/create-cert)\n\n`create-cert` is a convenient wrapper around the [`pem`](https://github.com/Dexus/pem) module. It generates a self signed certificate with sensible defaults along with an associated CA certificate to validate against. It has a Promise based API and returns the keys in a format that can be passed directly into `https.createServer`.\n\n## Install\n\n```shell\nnpm install --save create-cert\n```\n\n## Usage\n\n```js\nconst createCert = require('create-cert');\n\ncreateCert().then(keys =\u003e console.log(keys));\n// {\n//   key: '-----BEGIN RSA PRIVATE KEY-----\\n...',\n//   cert: '-----BEGIN CERTIFICATE-----\\n...',\n//   caCert: '-----BEGIN CERTIFICATE-----\\n...'\n// }\n```\n\nYou can create a fully functioning HTTPS server like so:\n\n```js\ncreateCert().then(keys =\u003e {\n   https.createServer(keys, (req, res) =\u003e res.end('Hi!')).listen(443);\n});\n```\n\nFor strict SSL usage you can set the common name for the certificate and validate it against the CA certificate. An example using the [Got](https://github.com/sindresorhus/got) request client:\n\n```js\ncreateCert('foobar.com').then(keys =\u003e {\n   https.createServer(keys, (req, res) =\u003e res.end('Hi!')).listen(443, () =\u003e {\n     // This request will succeed without issues\n     // as the SSL certificate will successfully\n     // validate against the CA certificate.\n     got('https://foobar.com', { ca: keys.caCert });\n   });\n});\n```\n\n## API\n\n### createCert([options])\n\nReturns a Promise which resolves to a `keys` object.\n\n#### options\n\nType: `string`, `object`\u003cbr\u003e\nDefault: `{ days: 365, commonName: 'example.com' }`\n\nIf a string is passed in, it will be used as the `commonName`. You can pass in any valid option for [`pem.createCertificate()`](https://github.com/Dexus/pem#create-a-certificate) to override the defaults.\n\n## Related\n\n- [`create-test-server`](https://github.com/lukechilds/create-test-server) - Creates a minimal Express server for testing\n\n## License\n\nMIT © Luke Childs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukechilds%2Fcreate-cert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukechilds%2Fcreate-cert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukechilds%2Fcreate-cert/lists"}