Giter Site home page Giter Site logo

syswide-cas's Introduction

syswide-cas

Enable node to use custom certificate authorities in conjunction with the bundled root CAs.

Node does not support system-wide installed trusted certificate authorities. It is 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.

This module enables loading custom CAs located in the file /etc/ssl/ca-node.pem in conjunction with the node bundled root CAs.

Installation

npm install --save syswide-cas

Usage

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

// "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

syswide-cas's People

Contributors

fujifish avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.