{"id":19427824,"url":"https://github.com/stacksjs/tlsx","last_synced_at":"2025-04-09T23:19:51.712Z","repository":{"id":226817485,"uuid":"769407229","full_name":"stacksjs/tlsx","owner":"stacksjs","description":"🔐 A TLS library with automation. HTTPS by default through a light-weight library. Similar to mkcert.","archived":false,"fork":false,"pushed_at":"2025-01-22T22:26:51.000Z","size":2309,"stargazers_count":34,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-24T09:11:14.658Z","etag":null,"topics":["dev-tool","https","library","local-development","mkcert","ssl-certificates","tls"],"latest_commit_sha":null,"homepage":"https://tlsx.sh","language":"TypeScript","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/stacksjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-09T01:53:45.000Z","updated_at":"2025-01-22T11:53:47.000Z","dependencies_parsed_at":"2024-03-20T00:32:05.019Z","dependency_job_id":"4f368f14-4741-46c2-b041-bc04ea44c9a4","html_url":"https://github.com/stacksjs/tlsx","commit_stats":null,"previous_names":["stacksjs/tlsx"],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Ftlsx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Ftlsx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Ftlsx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Ftlsx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stacksjs","download_url":"https://codeload.github.com/stacksjs/tlsx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125988,"owners_count":21051845,"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":["dev-tool","https","library","local-development","mkcert","ssl-certificates","tls"],"created_at":"2024-11-10T14:12:59.112Z","updated_at":"2025-04-09T23:19:51.693Z","avatar_url":"https://github.com/stacksjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\".github/art/cover.png\" alt=\"Social Card of this repo\"\u003e\u003c/p\u003e\n\n[![npm version][npm-version-src]][npm-version-href]\n[![GitHub Actions][github-actions-src]][github-actions-href]\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\u003c!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] --\u003e\n\u003c!-- [![Codecov][codecov-src]][codecov-href] --\u003e\n\n# tlsx\n\n\u003e A TLS library with automation. HTTPS by default through a light-weight library and/or CLI. Similar to mkcert.\n\n## Features\n\n- 🔒 SSL Support _(HTTPS by default)_\n- 0️⃣ Zero-Config \u0026 Zero-Setup HTTPS\n- 🛠️ Configurable Library \u0026 CLI\n- 🔀 Multi-domain Support\n- 🏗️ Cross-platform System Trust Store Integration\n\n## Install\n\n```bash\nbun install -d @stacksjs/tlsx\n\n# or, invoke immediately\nbunx @stacksjs/tlsx\nnpx @stacksjs/tlsx\n```\n\nPlease note, we are looking to publish this package to npm under the name `tlsx`. _Hoping npm will release the name for us._\n\n\u003c!-- _Alternatively, you can install:_\n\n```bash\nbrew install tlsx # wip\npkgx install tlsx # wip\n``` --\u003e\n\n## Get Started\n\nThere are two ways of using this reverse proxy: _as a library or as a CLI._\n\n### Library\n\nGiven the npm package is installed:\n\n```ts\nimport type { AddCertOptions, CAOptions, CertificateOptions, TlsConfig, TlsOptions } from '@stacksjs/tlsx'\nimport { addCertToSystemTrustStoreAndSaveCerts, config, forge, generateCert, pki, storeCertificate, tls } from '@stacksjs/tlsx'\n\n// Generate a certificate for a single domain\nconst cert = await generateCertificate({\n  domain: 'example.com',\n  rootCA: existingCA,\n  validityDays: 365,\n})\n\n// Generate a certificate for multiple domains\nconst multiDomainCert = await generateCertificate({\n  domains: ['example.com', 'api.example.com', '*.example.com'],\n  rootCA: existingCA,\n  validityDays: 365,\n})\n\n// Generate a certificate with both primary domain and additional domains\nconst combinedCert = await generateCertificate({\n  domain: 'example.com',\n  domains: ['api.example.com', '*.example.com'],\n  rootCA: existingCA,\n  validityDays: 365,\n})\n\n// Store and trust the certificate\nawait addCertToSystemTrustStoreAndSaveCert(cert, rootCA.certificate)\n```\n\n### CLI\n\n```bash\n# Generate certificate for a single domain\ntlsx secure example.com\n\n# Generate certificate for multiple domains\ntlsx secure -d \"example.com,api.example.com,*.example.com\"\n\n# Generate certificate with primary domain and additional domains\ntlsx secure example.com -d \"api.example.com,*.example.com\"\n\n# Generate certificate with custom validity and organization\ntlsx secure example.com --validity-days 365 --organization-name \"My Company\"\n\n# Show all available options\ntlsx secure --help\n\n# Show version\ntlsx version\n```\n\n## Configuration\n\n`tlsx` can be configured using a `tls.config.ts` _(or `tls.config.js`)_ file and it will be automatically loaded when running the `tlsx` command.\n\n```ts\n// tlsx.config.{ts,js}\nimport type { TlsConfig } from '@stacksjs/tlsx'\n\nexport default {\n  domain: 'stacks.localhost',\n  hostCertCN: 'stacks.localhost',\n  caCertPath: path.join(os.homedir(), '.stacks', 'ssl', `tlsx.localhost.ca.crt`),\n  certPath: path.join(os.homedir(), '.stacks', 'ssl', `tlsx.localhost.crt`),\n  keyPath: path.join(os.homedir(), '.stacks', 'ssl', `tlsx.localhost.crt.key`),\n  altNameIPs: ['127.0.0.1'],\n  altNameURIs: ['localhost'],\n  organizationName: 'stacksjs.org',\n  countryName: 'US',\n  stateName: 'California',\n  localityName: 'Playa Vista',\n  commonName: 'stacks.localhost',\n  validityDays: 180,\n  verbose: false,\n} satisfies TlsConfig\n```\n\n_Then run:_\n\n```bash\ntlsx\n```\n\nTo learn more, head over to the [documentation](https://tlsx.sh/).\n\n## Testing\n\n```bash\nbun test\n```\n\n## Changelog\n\nPlease see our [releases](https://github.com/stacksjs/tlsx/releases) page for more information on what has changed recently.\n\n## Contributing\n\nPlease review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.\n\n## Community\n\nFor help, discussion about best practices, or any other conversation that would benefit from being searchable:\n\n[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)\n\nFor casual chit-chat with others using this package:\n\n[Join the Stacks Discord Server](https://discord.gg/stacksjs)\n\n## Postcardware\n\n“Software that is free, but hopes for a postcard.” We love receiving postcards from around the world showing where `tlsx` is being used! We showcase them on our website too.\n\nOur address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎\n\n## Sponsors\n\nWe would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.\n\n- [JetBrains](https://www.jetbrains.com/)\n- [The Solana Foundation](https://solana.com/)\n\n## Credits\n\n- [Chris Breuer](https://github.com/chrisbbreuer)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.\n\nMade with 💙\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/@stacksjs/tlsx?style=flat-square\n[npm-version-href]: https://npmjs.com/package/@stacksjs/tlsx\n[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/tlsx/ci.yml?style=flat-square\u0026branch=main\n[github-actions-href]: https://github.com/stacksjs/tlsx/actions?query=workflow%3Aci\n\n\u003c!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/tlsx/main?style=flat-square\n[codecov-href]: https://codecov.io/gh/stacksjs/tlsx --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Ftlsx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstacksjs%2Ftlsx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Ftlsx/lists"}