Skip to main content

ssllabs

This project implements the Qualys SSL Labs API in python. It uses API version 3. All methods are async.

System requirements

Defining the system requirements with exact versions typically is difficult. But there is a tested environment:

  • Linux
  • Python 3.7.9
  • pip 20.3.3
  • dacite 1.6.0
  • httpx 0.16.1

Other versions and even other operating systems might work. Feel free to tell us about your experience. If you want to run our unit tests, you also need:

  • pytest 4.5.0
  • pytest-asyncio 0.14.0
  • pytest-mock 6.2.1
  • asynctest 0.13.0

Versioning

In our versioning we follow Semantic Versioning.

Installing for usage

The Python Package Index takes care for you. Just use pip.

pip install ssllabs

Installing for development

First, you need to get the sources.

git clone git@github.com:devolo/ssllabs.git

Then you need to take care of the requirements.

cd ssllabs
python setup.py install

If you want to run out tests, install the extra requirements and start pytest.

pip install -e .[test]
pytest

High level usage

If you want to cover on the common usage cases, you can use our high level implementations.

Analyzing a host

import asyncio

from ssllabs import Ssllabs

async def analyze():
    ssllabs = Ssllabs()
    return await ssllabs.analyze(host="devolo.de")

asyncio.run(analyze())

This will give you a Host object as dataclass. This call runs quite long as it takes time to run all tests. You probably know that from using the webinterface.

Check availability of the SSL Labs servers

import asyncio

from ssllabs import Ssllabs

async def availability():
    ssllabs = Ssllabs()
    return await ssllabs.availability()

asyncio.run(availability())

This will give you True, if the servers are up and running, otherwise False. It will also report False, if you exeeded your rate limits.

Retrieve API information

import asyncio

from ssllabs import Ssllabs

async def info():
    ssllabs = Ssllabs()
    return await ssllabs.info()

asyncio.run(info())

This will give you an Info object as dataclass.

Retrieve root certificates

import asyncio

from ssllabs import Ssllabs

async def root_certs():
    ssllabs = Ssllabs()
    return await ssllabs.root_certs(trust_store=1)

asyncio.run(root_certs())

This will give you a string containing the latest root certificates used for trust validation. By default it used the certificates provided by Mozilla. You can choose a differenty store by changing trust_store to 1: Mozilla, 2: Apple MacOS, 3: Android, 4: Java or 5: Windows.

Retrieve known status codes

import asyncio

from ssllabs import Ssllabs

async def status_codes():
    ssllabs = Ssllabs()
    return await ssllabs.status_codes()

asyncio.run(status_codes())

This will give you a StatusCodes object as dataclass.

Low level usage

If the high level methods do not match your use case, you can access each API call.

import asyncio

from ssllabs.api import Endpoint

async def get_grade():
    api = Endpoint()
    endpoint = await api.get(host="devolo.de", s="195.201.179.93")
    return endpoint.grade

Classes are called like the API call without the leading get. The get method will query the API. It will take the parameters like in the documentation and return a dataclass representing the object, the API describes. One exception in the naming: the getEndpointData call is implemented in the Endpoint class to be able to better distinguish it from its EndpointData result object.

Release files for ssllabs 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ssllabs 0.1.1
File Size Uploaded
ssllabs-0.1.1.tar.gz 16.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ssllabs 0.1.1
File Interpreter ABI Platform
ssllabs-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 42.6 kB

Release files / ssllabs-0.1.1.tar.gz

Download URL ssllabs-0.1.1.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7ff10a998da64f1fde60729c5a6195f34029ac451c66a817b42d406379bda89e
BLAKE2b-256 checksum
How to use checksums
1180318db286dba60d2a749571981df41dce84505a87b2fabe7455bc194976e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

Release files / ssllabs-0.1.1-py3-none-any.whl

Download URL ssllabs-0.1.1-py3-none-any.whl
Size 26.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5fc1218705f09619732caf41b9669789cc02737716a2842d738ed475bc7fc701
BLAKE2b-256 checksum
How to use checksums
50e963c2c14e6dec8c27721546ea98261855e2396ed6630548b17e5d8c7f6007
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

Release history Release notifications | RSS feed

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page