Module ssllabs

Lua module for the Qualys SSL Labs Server Test

Info:

  • Copyright: 2019
  • License: MIT
  • Author: Sebastian Huebner

Functions

info () Check availability of the SSL Labs servers and some other data like software version.
analyze (opts) Invoke assessment and check progress.
from_cache (host[, maxAge]) Retrieve cached assessment report.
new_assessment (opts) Start new assessment.
get_endpoint_data (opts) Retrieve detailed endpoint information.
get_status_codes () Retrieve known status codes.
get_root_certs_raw () Retrieve root certificates.


Functions

info ()
Check availability of the SSL Labs servers and some other data like software version. Implements the info API call

Returns:

  1. table or nil Info table / In case of error nil
  2. number error status code
  3. string error status message

Usage:

    local info = ssllabs.info()
analyze (opts)
Invoke assessment and check progress. This call is used to initiate an assessment, or to retrieve the status of an assessment in progress or in the cache. Implements the analyze API call

Parameters:

  • opts options table with arguments
    • host string hostname
    • publish bool if set to 'on' or true the result will be published on the public result boards. (default false)
    • startNew bool if set to 'on' or true a new assessment is started. However, if there's already an assessment in progress, its status is delivered instead. (default false)
    • fromCache bool if set to 'on' or true cached assessment reports will be returned. (default true)
    • maxAge number maximum report age, in hours, if retrieving from cache (fromCache parameter set). (default 10)
    • all string by default this call results only summaries of individual endpoints. If this parameter is set to on, full information will be returned. If set to done, full information will be returned only if the assessment is complete (status is READY or ERROR). (default 'done')
    • ignoreMismatch bool set to on to proceed with assessments even when the server certificate doesn't match the assessment hostname. Please note that this parameter is ignored if a cached report is returned. (default false)

Returns:

  1. table or nil Host table
  2. nil or number error status code
  3. nil or string error status message

Usage:

    local result = ssllabs.analyze({
      host = 'example.com',
      fromCache = true,
      maxAge = 36
    })
from_cache (host[, maxAge])
Retrieve cached assessment report. Short for ssllabs.analyze({host = host, fromCache = true}).

Parameters:

  • host string hostname
  • maxAge number maximum report age, in hours, if retrieving from cache (fromCache parameter set). (optional)

Returns:

  1. table or nil Host table
  2. nil or number error status code
  3. nil or string error status message

Usage:

    local result = ssllabs.from_cache('example.com', 36)
new_assessment (opts)
Start new assessment. Short for ssllabs.analyze({host = host, startNew = true}).

Parameters:

  • opts options table with arguments
    • host string hostname
    • publish bool if set to 'on' or true the result will be published on the public result boards. (default false)
    • ignoreMismatch bool set to on to proceed with assessments even when the server certificate doesn't match the assessment hostname. Please note that this parameter is ignored if a cached report is returned. (default false)

Returns:

  1. table or nil Host table
  2. nil or number error status code
  3. nil or string error status message

Usage:

    local result = ssllabs.new_assessment({
      host = 'example.com',
      publish = true,
      ignoreMismatch = false
    })
get_endpoint_data (opts)
Retrieve detailed endpoint information. This call is used to retrieve detailed endpoint information. Implements the getEndpointData API call

Parameters:

  • opts options table with arguments
    • host string hostname
    • s string endpoint IP address
    • fromCache bool (default true)

Returns:

  1. table or nil Endpoint table
  2. nil or number error status code
  3. nil or string error status message

Usage:

    local ep_data = ssllabs.get_endpoint_data()
get_status_codes ()
Retrieve known status codes.

Returns:

  1. table or nil StatusCode table
  2. nil or number error status code
  3. nil or string error status message

Usage:

    local code = ssllabs.get_status_codes()
get_root_certs_raw ()
Retrieve root certificates.

Returns:

    string This call returns the root certificates used for trust validation.

Usage:

    local certs = ssllabs.get_root_certs_raw()
generated by LDoc 1.4.6 Last updated 2019-03-14 10:20:33