# @jad3n/system-ca

> Access the system certificate store on Windows, macOS and Linux

Latest version **1.0.2** (published 2023-11-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @jad3n/system-ca
pnpm add @jad3n/system-ca
yarn add @jad3n/system-ca
bun add @jad3n/system-ca
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-11-29 |
| First published | 2023-11-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 25.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | jad3n |
| Keywords | system, cert, certificate, ca, windows, macos, linux |

## Links

- npm: https://www.npmjs.com/package/@jad3n/system-ca
- Repository: https://github.com/mongodb-js/system-ca
- Issues: https://github.com/mongodb-js/system-ca/issues
- npm.io page: https://npm.io/package/@jad3n/system-ca

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2023-11-29

## README

# system-ca

Access the system certificate store on Windows, macOS and Linux.

```js
import { systemCertsSync, systemCertsAsync } from 'system-ca';

console.log(systemCertsSync())
console.log(await systemCertsAsync())

tls.connect({
  host: 'google.com',
  port: 443,
  ca: await systemCertsAsync({ includeNodeCertificates: true })
})
```

The `systemCertsSync()` and `systemCertsAsync()` functions perform the same
operation, namely, listing all trusted certificates as an array of PEM-formatted
X.509 certificates.

The result can be passed directly to the `ca` option of `tls.connect()`
and similar methods.

- Using `systemCertsAsync()` may be preferable, because accessing the
  system store can be slow, especially on Windows.
- `systemCertsAsync()` uses a worker thread under the hood on Windows and macOS.
- On Windows and macOS, this package always uses native addons for accessing
  the system certificate store.
- On all other platforms, both the async and the sync variant read from the
  typical system locations for storing trusted certificates (i.e. `/etc/ssl`, `/etc/pki`).

## LICENSE

Apache-2.0

---
_Source: https://npm.io/package/@jad3n/system-ca · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
