Package Exports
- node-ssllabs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-ssllabs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-ssllabs
A node.js library for the SSL Labs API.
SSL Labs APIs expose the complete SSL/TLS server testing functionality in a programmatic fashion, allowing for scheduled and bulk assessment. We are making the APIs available to encourage site operators to regularly test their server configuration.
Install
npm install node-ssllabs
Usage
var ssllabs = require("node-ssllabs");
ssllabs.scan("www.ssllabs.com", function (err, host) {
console.dir(host);
});
Test Usage
Testing with Mocha and Should.js.
var ssllabs = require("node-ssllabs"),
should = require("should");
describe("www.ssllabs.com", function () {
it("should get an A+", function (done) {
ssllabs.scan("www.ssllabs.com", function (err, host) {
if (err) {
throw err;
}
host.endpoints.forEach(function (endpoint) {
endpoint.grade.should.equal("A+");
});
done();
});
});
});
Advanced Usage
var ssllabs = require("node-ssllabs");
ssllabs.scan({
"host": "www.ssllabs.com",
"fromCache": true,
"maxAge": 24
}, function (err, host) {
console.dir(host);
});
ssllabs.info(function (err, info) {
console.dir(info);
});
ssllabs.analyze({
"host": "www.ssllabs.com",
"publish": true,
"startNew": true,
"all": "done"
}, function (err, host) {
console.dir(host);
});
ssllabs.analyze({
"host": "www.ssllabs.com",
"fromCache": true,
"maxAge": 72,
"all": "on",
"ignoreMismatch": true
}, function (err, host) {
console.dir(host);
});
ssllabs.getEndpointData({
"host": "www.ssllabs.com",
"s": "64.41.200.100",
"fromCache": true
}, function (err, endpointData) {
console.dir(endpointData);
});
ssllabs.getStatusCodes(function (err, statusCodes) {
console.dir(statusCodes);
});
ssllabs.getRootCertsRaw(function (err, rootCertsRaw) {
console.dir(rootCertsRaw);
});
License
node-ssllabs is available under the MIT License.
Todo
- add support for access rate and rate limiting
- incorporate new info field, newAssessmentCoolOff, to access rate and rate limiting
- add option to specify an array of hosts to scan
- have the
scan
function emit events for polling progress - figure out if the maxAge parameter is required with the fromCache parameter
Change Log
0.5.0 – July 14, 2016
- added support for new API call, getRootCertsRaw
- improved testing with Mocha
- improved normalizeOptions() function
- updated documentation
0.4.3 — May 1, 2015
- removed requirement that maxAge must be set if fromCache is set
- added check that fromCache is set if maxAge is set
- fixed bug where NaN was accepted for the maxAge parameter
0.4.2 — April 27, 2015
- added call to
info
before callinganalyze
in thescan
function
0.4.1 — April 27, 2015
- refactored
scan
function to useanalyze
function for dryness - improved test to ensure parallel scanning maintains context
0.4.0 — April 23, 2015
- added option to only specify a hostname for scanning
- added test for lost context in parallel scans
- added test if
startNew
andfromCache
options are both true - added additional parameter tests and verification
0.3.0 — April 21, 2015
- added
scan
function to encapsulate protocol usage
0.2.0 — April 20, 2015
- updated to work properly in other packages.
0.1.0 — April 20, 2015
- added support for the
getEndpointData
api endpoint. - added support for the
getStatusCodes
api endpoint. - improved error handling and reporting.
0.0.1 — April 20, 2015
Initial version
supports two api endpoints,
info
andanalyze