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:
- table or nil Info table / In case of error nil
- number error status code
- 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'
ortrue
the result will be published on the public result boards. (default false) - startNew
bool
if set to
'on'
ortrue
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'
ortrue
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 todone
, full information will be returned only if the assessment is complete (status isREADY
orERROR
). (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:
- table or nil Host table
- nil or number error status code
- nil or string error status message
Usage:
local result = ssllabs.analyze({ host = 'example.com', fromCache = true, maxAge = 36 })
- opts options table with arguments
- 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:
- table or nil Host table
- nil or number error status code
- 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'
ortrue
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:
- table or nil Host table
- nil or number error status code
- nil or string error status message
Usage:
local result = ssllabs.new_assessment({ host = 'example.com', publish = true, ignoreMismatch = false })
- opts options table with arguments
- 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
Returns:
- table or nil Endpoint table
- nil or number error status code
- nil or string error status message
Usage:
local ep_data = ssllabs.get_endpoint_data()
- get_status_codes ()
-
Retrieve known status codes.
Returns:
- table or nil StatusCode table
- nil or number error status code
- 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()