Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ServerNetworkLocation
✓ from sslyze import ServerNetworkLocation
Scanner
✓ from sslyze import Scanner
ServerScanRequest
✓ from sslyze import ServerScanRequest
ScanCommand
✓ from sslyze.plugins.scan_commands import ScanCommand
✗ from sslyze import ScanCommand
In sslyze < 6.0? Actually in current version ScanCommand is exported from sslyze.plugins.scan_commands. But docs show direct import from sslyze. VERIFY.
Basic asynchronous scan of a TLS server using the Python API.
import asyncio
from sslyze import ServerNetworkLocation, Scanner, ServerScanRequest
from sslyze.plugins.scan_commands import ScanCommand
async def scan():
server_location = ServerNetworkLocation(hostname="www.google.com", port=443)
scanner = Scanner()
scan_request = ServerScanRequest(
server_location=server_location,
scan_commands={
ScanCommand.TLS_1_2_CIPHER_SUITES,
ScanCommand.CERTIFICATE_INFO,
},
)
result = await scanner.scan_async(scan_request)
print(result)
asyncio.run(scan())
sslyze --version
Errors
Common errors & fixes
AttributeError: module 'sslyze' has no attribute 'ScanCommand'
ScanCommand is not directly in the sslyze module; it's in sslyze.plugins.scan_commands.
fixUse: from sslyze.plugins.scan_commands import ScanCommand
TypeError: scan() takes 1 positional argument but 2 were given
Older synchronous API used scanner.scan(server_info). In v6+, use async API: await scanner.scan_async(scan_request).
fixUse async/await and ServerScanRequest object.
ImportError: cannot import name 'ServerNetworkLocation' from 'sslyze'
Old sslyze (<6) had different import paths. In v6+, import from sslyze directly.
fixUpgrade sslyze to >=6, then use: from sslyze import ServerNetworkLocation
RuntimeError: asyncio.run() cannot be called from a running event loop
Calling asyncio.run() inside a Jupyter notebook or another async context.
fixUse await or run in a new event loop with nest_asyncio.
pydantic.error_wrappers.ValidationError: (...) for ScanCommand
Passing invalid enum values or mixing strings/enums.
fixUse ScanCommand enum members (e.g., ScanCommand.CERTIFICATE_INFO) not strings.
Upgrade
Version history
6.3.1latest on PyPI · released Mar 29, 2026
Audit
Dependencies
cryptographyrequiredCore dependency for TLS operations, bound to >=43,<47 in 6.3.1
nasslrequiredUnderlying TLS library used by sslyze for low-level TLS handshakes
pydanticrequiredUsed for data validation and settings (starting from 5.2.0+)