1.0.1 • Published 8 years ago

ssldecoder v1.0.1

Weekly downloads
5
License
Unlicense
Repository
github
Last release
8 years ago

ssldecoder

Check your domain SSL/TLS setup with the SSL Decoder.org API (unofficial)

npm Build Status Dependency Status Test Coverage

Example

var ssldecoder = require ('ssldecoder') ();

// Process response data
function processHost (err, data) {
  if (err) {
    console.log (err);
    return;
  }
  
  console.log (data.connection.protocols);
}

// Get certificate details
ssldecoder.host ('myhostname.net', processHost);

Installation

npm install ssldecoder

Configuration

paramtyperequireddefaultdescription
timeoutnumberno20000Request wait time out in ms, 1000 = 1 sec
endpointstringnohttps://ssldecoder.orgSend calls to another API

Example

// Set timeout to 5 seconds and your own server
var ssldecoder = require ('ssldecoder') ({
  timeout: 5000,
  endpoint: 'https://my-box.tld/path'
});

Method .host

( params, callback )

Retrieve certificate details from a hostname.

Arguments

paramtyperequireddescription
paramsobject or stringyesHostname (string) or parameters (object)
callbackfunctionyesfunction (err, data) {}
Parameters
paramtyperequireddefaultdescription
params.hoststringno *resolved from ipHostname
params.ipstringno *resolved from hostIP address
params.portnumberno443HTTPS port
params.fastcheckbooleannofalseLimited connection data enumeration, no certificate transparency submission

Always provide either host or ip, or ideally both! Otherwise the host or ip is DNS resolved from the other, selecting only the first result it gets.

Example

// Only hostname, let the module lookup the IP
ssldecoder.host ('myhostname.net', processData);

// Only IP, let the module lookup the hostname
var params = {
  ip: '2a01:7c8:aab3:35a::3',
  fastcheck: true
};

ssldecoder.host (params, processData);

// Full control with hostname and IP
var params = {
  host: 'myhostname.net',
  ip: '1.2.3.4'
};

ssldecoder.host (params, processData);

Method .csr

( csr, callback )

Process CSR PEM

Arguments

argumenttyperequireddescription
csrstringyesEither /path/to/csr.pem or full PEM string
callbackfunctionyesfunction (err, data) {}

Example

// Read PEM from path
ssldecoder.csr ('csr.pem', processCSR);

// Send PEM text
var pem = '-----BEGIN CERTIFICATE REQUEST-----\n...';

ssldecoder.csr (pem, processCSR);

Unlicense

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to http://unlicense.org

Author

Franklin van de Meent