Sha256: bd3b87e0dff150303338e8a7d39e785377e0307480e314575e5ce83783c48b1d
Contents?: true
Size: 557 Bytes
Versions: 27
Compression:
Stored size: 557 Bytes
Contents
module.exports = loadCAFile var fs = require('fs') function loadCAFile(cafilePath, cb) { if (!cafilePath) return process.nextTick(cb) fs.readFile(cafilePath, 'utf8', afterCARead.bind(this)) function afterCARead(er, cadata) { if (er) return cb(er) var delim = '-----END CERTIFICATE-----' var output output = cadata .split(delim) .filter(function(xs) { return !!xs.trim() }) .map(function(xs) { return xs.trimLeft() + delim }) this.set('ca', output) cb(null) } }
Version data entries
27 entries across 20 versions & 3 rubygems