How to use win-ca - 2 common examples

To help you get started, we’ve selected a few win-ca examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github auth0 / ad-ldap-connector / admin / test_config.js View on Github external
    if (err) {
      return callback(err, result);

    var tlsOptions;

    if (config.LDAP_URL.toLowerCase().substr(0, 5) === 'ldaps') {

      var cas;

      if (process.platform === 'win32') {
        const ca = require('win-ca');
        cas = [];
          format: ca.der2.pem,
          store: ['root', 'ca', 'trustedpeople'],
          ondata: cas
      } else {
        cas =;

      tlsOptions = {
        ca: cas

      if (nconf.get('SSL_ENABLE_EMPTY_SUBJECT')) {
        // When enabled use the connector own verification function that fixes Node.js issue described in for details
        tlsOptions.checkServerIdentity = tls.checkServerIdentity;
github auth0 / ad-ldap-connector / lib / add_certs.js View on Github external
function readSystemCAs(cb) {
  switch(process.platform) {
    case 'win32':
      console.log('Reading CA certificates from Windows Store');
      const ca = require('win-ca');
      const list = [];
        format: ca.der2.pem,
        store: ['root', 'ca', 'trustedpeople'],
        ondata: list
      cb(null, => ({ pem: c })));
    case 'freebsd':
    case 'linux':
      console.log('Reading CA certificates from OPENSSLDIR');
      exec('openssl version -d', function(err, stdout, stderr){
        if (err) return cb(err);

        var match = SSL_OPENSSLDIR_PATTERN.exec(stdout);
        if (match && match.length > 1) {
          return readCertficatesFromPath(path.join(match[1], 'certs'), cb);


Get Windows System Root certificates

Latest version published 1 year ago

Package Health Score

57 / 100
Full package analysis

Popular win-ca functions

Popular JavaScript code snippets

Find secure code to use in your application or website