1.0.1 • Published 5 years ago

tlsinfo v1.0.1

Weekly downloads
5
License
MIT
Repository
-
Last release
5 years ago

Description

Geather detailed information on the TLS / SSL configuration of a given server.

Dependencies

  • Node.JS v8 or v9

Supports

  • IPv6
  • unicode dns names like plan-österreich.org
  • servers with multiple IPv4 and / or IPv6 addresses
  • timeout (per connection)
  • SNI (Server Name Indication)
  • ES6 async / await
  • automatic toString() and inspect() formating for more readable console and debiggng output of result data

Usage

Note: SNI is enabled and uses the value of the host option by default. To disable SNI set the option servername to null.

const { TlsServiceAudit } = require('tlsinfo')

const tlsServiceAuditTask = new TlsServiceAudit({
  host: task.host,
  port: task.port,
  // servername: null, // optional to set or disable SNI
})
const result = await tlsServiceAuditTask.run()

All options which can be defined in the constructor of TlsServiceAudit, Certificate, ProtocolVersion, Cipher and TlsSocketWrapper: github.com -> DefinitelyTyped -> node -> index.d.ts.

The result is a object defined as TlsServiceAuditResult. Here is a example result as a json object: compilenix.org/cdn/tlsinfo-example-audit-result.json\ Note: The unsupported list holds items that this lib can't test (because the Node.JS version does not support this particular ssl / tls / cipher combination).

If you only want to get the certificate/s you can use:

const { Certificate } = require('tlsinfo')

const certificate = new Certificate({
  host: task.host,
  port: task.port
})
const result = await certificate.fetch()

The same applies to protocols (TLS 1.0, 1.1 etc.) -> ProtocolVersion and ciphers (AES128-GCM-SHA256, DHE-RSA-AES128-SHA256 etc.) -> Cipher.

Heavily inspired by sslinfo.