https://github.com/indexzero/read-ssl
A simple node library to read SSL certificate files according to a basic convention.
https://github.com/indexzero/read-ssl
Last synced: 10 months ago
JSON representation
A simple node library to read SSL certificate files according to a basic convention.
- Host: GitHub
- URL: https://github.com/indexzero/read-ssl
- Owner: indexzero
- License: mit
- Created: 2015-05-07T23:26:01.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-02-01T22:20:19.000Z (over 10 years ago)
- Last Synced: 2024-10-18T21:04:20.913Z (over 1 year ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# read-ssl
A simple node library to read SSL certificate files according to a basic convention.
## Usage
``` js
var readSsl = require('read-ssl');
readSsl({
root: __dirname,
key: 'relative/path/to/file.key',
cert: 'relative/path/to/file.cert',
ca: 'relative/path/to/ca.pem'
//
// `ca` can alternatively be an Array
//
ca: [
'relative/path/to/ca.pem'
'relative/path/to/intermediate-ca.pem'
]
}, function (err, res) {
assert(Buffer.isBuffer(res.key));
assert(Buffer.isBuffer(res.cert));
assert(Buffer.isBuffer(res.ca));
});
```
`readSsl` can also be used to create the `crypto` context necessary for performing operations like responding appropriately to an `SNICallback`:
``` js
var readSsl = require('read-ssl');
readSsl.createContext({
root: __dirname,
key: 'relative/path/to/file.key',
cert: 'relative/path/to/file.cert'
}, function (err, context) {
//
// Context is the result of
// require('crypto').createCredentials().context
// with the result of a `readSsl` call.
//
});
```
##### AUTHOR: [Charlie Robbins](https://github.com/indexzero)
##### LICENSE: MIT