# syswide-cas

> Enable node to use system wide certificate authorities in conjunction with the bundled root CAs

Latest version **5.3.0** (published 2018-08-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install syswide-cas
pnpm add syswide-cas
yarn add syswide-cas
bun add syswide-cas
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.3.0 |
| Published | 2018-08-16 |
| First published | 2016-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Unpacked size | 8.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Capriza Inc. |
| Maintainers | fujifish |
| Keywords | tls, ca, root |

## Links

- npm: https://www.npmjs.com/package/syswide-cas
- Repository: https://github.com/capriza/syswide-cas
- Homepage: https://github.com/capriza/syswide-cas/
- Issues: https://github.com/capriza/syswide-cas/issues
- npm.io page: https://npm.io/package/syswide-cas

## 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

- 5.3.0 (latest) — 2018-08-16
- 5.2.0 — 2018-06-22
- 5.1.0 — 2018-04-13
- 5.0.0 — 2017-11-08
- 4.0.0 — 2017-07-01
- 3.0.0 — 2016-10-18
- 2.0.0 — 2016-10-18
- 1.0.0 — 2016-10-10

## README

<div align="center"><img src="https://capriza.github.io/images/logos/logos-cert.svg" height="128" /></div>

syswide-cas
===

Enable node to use custom certificate authorities _in conjunction_ with the bundled root CAs.

Up until version 7, node did not support system-wide installed trusted certificate authorities. It was only possible to specify a custom 
CA via the `ca` option in the `tls` and `https` modules, or fallback to using the bundled list of root CAs that 
node is compiled with. 

Starting with node 7, it's possible to set the `NODE_EXTRA_CA_CERTS` environment variable to a single file containing additional root CA
to trust, however it still does not allow programatic addition of several directories and files containing root CAs.

This module enables loading custom CAs to be used _in conjunction_ with the node bundled root CAs.
syswide-cas will auto load root CAs from the file `/etc/ssl/ca-node.pem` if it exists.


## Installation

```
npm install --save syswide-cas
```

## Usage

Add `require('syswide-cas')` as soon as possible as it affects all later TLS calls. 

```javascript
// "require('syswide-cas')" immediatley loads CAs from the file /etc/ssl/ca-node.pem if it exists
const syswidecas = require('syswide-cas');

// optionally load all files from a custom directory
syswidecas.addCAs('/my/custom/path/to/certs/dir');

// or multiple directories
syswidecas.addCAs(['/my/custom/path/to/certs/dir1', '/my/other/path/to/certs/dir2']);

// optionally load a file directly
syswidecas.addCAs('/my/custom/path/to/cert.pem');

// or multiple files
syswidecas.addCAs(['/my/custom/path/to/cert1.pem', '/my/other/path/to/cert2.pem']);


const https = require('https');
https.get('https://my.custom.domain.com/with/self/signed/cert');

```

## License

Copyright 2016 Capriza. Code released under the [MIT license](LICENSE.md)

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