{"id":22770065,"url":"https://github.com/devolo/ssllabs","last_synced_at":"2025-04-15T03:22:00.594Z","repository":{"id":53461202,"uuid":"331555486","full_name":"devolo/ssllabs","owner":"devolo","description":"Qualys SSL Labs API in python","archived":false,"fork":false,"pushed_at":"2025-02-03T05:35:08.000Z","size":184,"stargazers_count":8,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T15:05:09.546Z","etag":null,"topics":["tls"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devolo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-21T07:56:07.000Z","updated_at":"2024-11-29T16:00:13.000Z","dependencies_parsed_at":"2023-01-25T19:31:55.615Z","dependency_job_id":"701063b8-eb48-4b10-925f-9e0ada64f094","html_url":"https://github.com/devolo/ssllabs","commit_stats":{"total_commits":149,"total_committers":4,"mean_commits":37.25,"dds":"0.44966442953020136","last_synced_commit":"5936faa87a24dc1d6ab4e97fe58cba2cda99e009"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devolo%2Fssllabs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devolo%2Fssllabs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devolo%2Fssllabs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devolo%2Fssllabs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devolo","download_url":"https://codeload.github.com/devolo/ssllabs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997454,"owners_count":21195879,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["tls"],"created_at":"2024-12-11T15:19:02.894Z","updated_at":"2025-04-15T03:22:00.578Z","avatar_url":"https://github.com/devolo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ssllabs\n\nThis project implements the [Qualys SSL Labs](https://www.ssllabs.com/ssltest/) API in python. It uses [API version 3](https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs-v3.md). All methods are async.\n\n## System requirements\n\nDefining the system requirements with exact versions typically is difficult. But there is a tested environment:\n\n* Linux\n* Python 3.7.9\n* pip 20.3.3\n* dacite 1.6.0\n* httpx 0.16.1\n\nOther versions and even other operating systems might work. Feel free to tell us about your experience.\n\n## Versioning\n\nIn our versioning we follow [Semantic Versioning](https://semver.org/).\n\n## Installing for usage\n\nThe Python Package Index takes care for you. Just use pip.\n\n```bash\npip install ssllabs\n```\n\n## Installing for development\n\nFirst, you need to get the sources.\n\n```bash\ngit clone git@github.com:devolo/ssllabs.git\n```\n\nThen you need to take care of the requirements.\n\n```bash\ncd ssllabs\npython setup.py install\n```\n\n## High level usage\n\nIf you want to cover on the common usage cases, you can use our high level implementations.\n\n### Analyzing a host\n\n```python\nimport asyncio\n\nfrom ssllabs import Ssllabs\n\nasync def analyze():\n    ssllabs = Ssllabs()\n    return await ssllabs.analyze(host=\"devolo.de\")\n\nasyncio.run(analyze())\n```\n\nThis will give you a [Host object](https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs-v3.md#host) as dataclass. This call runs quite long as it takes time to run all tests. You probably know that from using the [webinterface](https://www.ssllabs.com/ssltest). If you don't need a fresh result on every run, you can allow using ssllabs' cache. This will speed up the tests, if there are cached results. The maximum cache validity can be set in full hour steps.\n\n```python\nimport asyncio\n\nfrom ssllabs import Ssllabs\n\nasync def analyze():\n    ssllabs = Ssllabs()\n    return await ssllabs.analyze(host=\"devolo.de\", from_cache=True, max_age=1)\n\nasyncio.run(analyze())\n```\n\n### Check availability of the SSL Labs servers\n\n```python\nimport asyncio\n\nfrom ssllabs import Ssllabs\n\nasync def availability():\n    ssllabs = Ssllabs()\n    return await ssllabs.availability()\n\nasyncio.run(availability())\n```\n\nThis will give you True, if the servers are up and running, otherwise False. It will also report False, if you exceeded your rate limits.\n\n### Retrieve API information\n\n```python\nimport asyncio\n\nfrom ssllabs import Ssllabs\n\nasync def info():\n    ssllabs = Ssllabs()\n    return await ssllabs.info()\n\nasyncio.run(info())\n```\n\nThis will give you an [Info object](https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs-v3.md#info) as dataclass.\n\n### Retrieve root certificates\n\n```python\nimport asyncio\n\nfrom ssllabs import Ssllabs\n\nasync def root_certs():\n    ssllabs = Ssllabs()\n    return await ssllabs.root_certs(trust_store=1)\n\nasyncio.run(root_certs())\n```\n\nThis 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 differently store by changing trust_store to 1: Mozilla, 2: Apple MacOS, 3: Android, 4: Java or 5: Windows.\n\n### Retrieve known status codes\n\n```python\nimport asyncio\n\nfrom ssllabs import Ssllabs\n\nasync def status_codes():\n    ssllabs = Ssllabs()\n    return await ssllabs.status_codes()\n\nasyncio.run(status_codes())\n```\n\nThis will give you a [StatusCodes object](https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs-v3.md#statuscodes) as dataclass.\n\n### Example to print the grade of multiple servers\n\nIf you are just interested in the grade of servers, you can take [this example](https://github.com/devolo/ssllabs/blob/master/example.py) as a starting point. Just exchange the list of hosts you want to query.\n\n## Low level usage\n\nIf the high level methods do not match your use case, you can access each [API call](https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs-v3.md#protocol-calls).\n\n```python\nimport asyncio\n\nfrom ssllabs.api import Endpoint\n\nasync def get_grade():\n    api = Endpoint()\n    endpoint = await api.get(host=\"devolo.de\", s=\"195.201.179.93\")\n    return endpoint.grade\n\nasyncio.run(get_grade())\n```\n\nClasses are called like the [API call](https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs-v3.md#protocol-calls) 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.\n\n## Exceptions\n\nThree types of exceptions might hit you, if the connection to SSL Labs' API is affected: ```httpx.ConnectTimeout``` or ```httpx.ReadTimeout``` appear, if the servers are down, and ```httpx.HTTPStatusError``` appears, if there is a client or server [error response](https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs-v3.md#error-response-status-codes). In this cases, you are asked to wait 15 to 30 minutes before you try again.\n\n## Using an own HTTP client\n\nIf you have special needs (e.g. what to use a proxy server), you can create an own HTTP client. Please read the [httpx documentation](https://www.python-httpx.org/advanced) to find out which possibilities you have.\n\n```python\nimport asyncio\n\nfrom httpx import AsyncClient\nfrom ssllabs import Ssllabs\n\nasync def analyze():\n    async with AsyncClient(proxies=\"http://localhost:8030\") as client:\n        ssllabs = Ssllabs(client)\n        return await ssllabs.analyze(host=\"devolo.de\")\n\nasyncio.run(analyze())\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevolo%2Fssllabs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevolo%2Fssllabs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevolo%2Fssllabs/lists"}