ssllabs.api package#

Submodules#

ssllabs.api.analyze module#

Invoke assessment and check progress.

class ssllabs.api.analyze.Analyze(client: AsyncClient | None = None)#

Bases: _Api

Invoke assessment and check progress.

See also: ssllabs/ssllabs-scan

async get(host: str, **kwargs: Any) HostData#

Analyze host.

Parameters:
  • host (str) – Hostname to analyze

  • publish (str) – Set to “on” if assessment results should be published on the public results boards; optional, defaults to “off”.

  • startNew (str) – If set to “on” then cached assessment results are ignored and a new assessment is started. However, if there’s already an assessment in progress, its status is delivered instead. This parameter should be used only once to initiate a new assessment; further invocations should omit it to avoid causing an assessment loop.

  • fromCache (str) – Always deliver cached assessment reports if available; optional, defaults to “off”. This parameter is intended for API consumers that don’t want to wait for assessment results. Can’t be used at the same time as the startNew parameter.

  • maxAge (int) – Maximum report age, in hours, if retrieving from cache (fromCache parameter set).

  • all (str) – 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).

  • ignoreMismatch (str) – Set to “on” to proceed with assessments even when the server certificate doesn’t match the assessment hostname. Set to off by default. Please note that this parameter is ignored if a cached report is returned.

Raises:
  • SsllabsUnavailableError – The SSL Labs service is not available.

  • SsllabsOverloadedError – The SSL Labs service is overloaded. You should reduce your usage or wait a bit.

  • HTTPStatusError – Something unexpected happened. Please file us a bug.

  • MissingValueError – Something unexpected happened. Please file us a bug.

ssllabs.api.endpoint module#

Retrieve detailed endpoint information.

class ssllabs.api.endpoint.Endpoint(client: AsyncClient | None = None)#

Bases: _Api

Retrieve detailed endpoint information.

See also: ssllabs/ssllabs-scan

async get(host: str, s: str, **kwargs: Any) EndpointData#

Retrieve detailed endpoint information.

Parameters:
  • host (str) – Hostname to analyze

  • s (str) – Endpoint IP address

  • fromCache (str) – Always deliver cached assessment reports if available; optional, defaults to “off”. This parameter is intended for API consumers that don’t want to wait for assessment results. Can’t be used at the same time as the startNew parameter.

Raises:
  • EndpointError – The endpoint API responded with an error.

  • SsllabsUnavailableError – The SSL Labs service is not available.

  • SsllabsOverloadedError – The SSL Labs service is overloaded. You should reduce your usage or wait a bit.

  • HTTPStatusError – Something unexpected happened. Please file us a bug.

  • MissingValueError – Something unexpected happened. Please file us a bug.

ssllabs.api.info module#

General information about the SSL Labs API.

class ssllabs.api.info.Info(client: AsyncClient | None = None)#

Bases: _Api

General information about the SSL Labs API.

See also: ssllabs/ssllabs-scan

async get() InfoData#

Get information.

Raises:
  • SsllabsUnavailableError – The SSL Labs service is not available.

  • SsllabsOverloadedError – The SSL Labs service is overloaded. You should reduce your usage or wait a bit.

  • HTTPStatusError – Something unexpected happened. Please file us a bug.

  • MissingValueError – Something unexpected happened. Please file us a bug.

ssllabs.api.root_certs_raw module#

Retrieve root certificates.

class ssllabs.api.root_certs_raw.RootCertsRaw(client: AsyncClient | None = None)#

Bases: _Api

Retrieve root certificates.

See also: ssllabs/ssllabs-scan

async get(**kwargs: Any) str#

Retrieve root certificates.

Parameters:

trustStore (TrustStore) – 1-Mozilla(default), 2-Apple MacOS, 3-Android, 4-Java, 5-Windows

Raises:
  • SsllabsUnavailableError – The SSL Labs service is not available.

  • SsllabsOverloadedError – The SSL Labs service is overloaded. You should reduce your usage or wait a bit.

  • HTTPStatusError – Something unexpected happened. Please file us a bug.

  • MissingValueError – Something unexpected happened. Please file us a bug.

ssllabs.api.status_codes module#

Retrieve known status codes.

class ssllabs.api.status_codes.StatusCodes(client: AsyncClient | None = None)#

Bases: _Api

Retrieve known status codes.

See also: ssllabs/ssllabs-scan

async get() StatusCodesData#

Retrieve known status codes.

Raises:
  • SsllabsUnavailableError – The SSL Labs service is not available.

  • SsllabsOverloadedError – The SSL Labs service is overloaded. You should reduce your usage or wait a bit.

  • HTTPStatusError – Something unexpected happened. Please file us a bug.

  • MissingValueError – Something unexpected happened. Please file us a bug.

Module contents#

Low level implementation of the SSL Labs API.

class ssllabs.api.Analyze(client: AsyncClient | None = None)#

Bases: _Api

Invoke assessment and check progress.

See also: ssllabs/ssllabs-scan

async get(host: str, **kwargs: Any) HostData#

Analyze host.

Parameters:
  • host (str) – Hostname to analyze

  • publish (str) – Set to “on” if assessment results should be published on the public results boards; optional, defaults to “off”.

  • startNew (str) – If set to “on” then cached assessment results are ignored and a new assessment is started. However, if there’s already an assessment in progress, its status is delivered instead. This parameter should be used only once to initiate a new assessment; further invocations should omit it to avoid causing an assessment loop.

  • fromCache (str) – Always deliver cached assessment reports if available; optional, defaults to “off”. This parameter is intended for API consumers that don’t want to wait for assessment results. Can’t be used at the same time as the startNew parameter.

  • maxAge (int) – Maximum report age, in hours, if retrieving from cache (fromCache parameter set).

  • all (str) – 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).

  • ignoreMismatch (str) – Set to “on” to proceed with assessments even when the server certificate doesn’t match the assessment hostname. Set to off by default. Please note that this parameter is ignored if a cached report is returned.

Raises:
  • SsllabsUnavailableError – The SSL Labs service is not available.

  • SsllabsOverloadedError – The SSL Labs service is overloaded. You should reduce your usage or wait a bit.

  • HTTPStatusError – Something unexpected happened. Please file us a bug.

  • MissingValueError – Something unexpected happened. Please file us a bug.

class ssllabs.api.Endpoint(client: AsyncClient | None = None)#

Bases: _Api

Retrieve detailed endpoint information.

See also: ssllabs/ssllabs-scan

async get(host: str, s: str, **kwargs: Any) EndpointData#

Retrieve detailed endpoint information.

Parameters:
  • host (str) – Hostname to analyze

  • s (str) – Endpoint IP address

  • fromCache (str) – Always deliver cached assessment reports if available; optional, defaults to “off”. This parameter is intended for API consumers that don’t want to wait for assessment results. Can’t be used at the same time as the startNew parameter.

Raises:
  • EndpointError – The endpoint API responded with an error.

  • SsllabsUnavailableError – The SSL Labs service is not available.

  • SsllabsOverloadedError – The SSL Labs service is overloaded. You should reduce your usage or wait a bit.

  • HTTPStatusError – Something unexpected happened. Please file us a bug.

  • MissingValueError – Something unexpected happened. Please file us a bug.

class ssllabs.api.Info(client: AsyncClient | None = None)#

Bases: _Api

General information about the SSL Labs API.

See also: ssllabs/ssllabs-scan

async get() InfoData#

Get information.

Raises:
  • SsllabsUnavailableError – The SSL Labs service is not available.

  • SsllabsOverloadedError – The SSL Labs service is overloaded. You should reduce your usage or wait a bit.

  • HTTPStatusError – Something unexpected happened. Please file us a bug.

  • MissingValueError – Something unexpected happened. Please file us a bug.

class ssllabs.api.RootCertsRaw(client: AsyncClient | None = None)#

Bases: _Api

Retrieve root certificates.

See also: ssllabs/ssllabs-scan

async get(**kwargs: Any) str#

Retrieve root certificates.

Parameters:

trustStore (TrustStore) – 1-Mozilla(default), 2-Apple MacOS, 3-Android, 4-Java, 5-Windows

Raises:
  • SsllabsUnavailableError – The SSL Labs service is not available.

  • SsllabsOverloadedError – The SSL Labs service is overloaded. You should reduce your usage or wait a bit.

  • HTTPStatusError – Something unexpected happened. Please file us a bug.

  • MissingValueError – Something unexpected happened. Please file us a bug.

class ssllabs.api.StatusCodes(client: AsyncClient | None = None)#

Bases: _Api

Retrieve known status codes.

See also: ssllabs/ssllabs-scan

async get() StatusCodesData#

Retrieve known status codes.

Raises:
  • SsllabsUnavailableError – The SSL Labs service is not available.

  • SsllabsOverloadedError – The SSL Labs service is overloaded. You should reduce your usage or wait a bit.

  • HTTPStatusError – Something unexpected happened. Please file us a bug.

  • MissingValueError – Something unexpected happened. Please file us a bug.