Join our Newsletter — 33% off our NHI Course
Home› Guides› testssl.sh and SSLyze Guide: Auditing TLS Configurations Across…
Guide Network Security

testssl.sh and SSLyze Guide: Auditing TLS Configurations Across Your Estate

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 15 min read
On this page

Most organisations have a TLS baseline on paper and no reliable way to prove every listener meets it. Two free, open source scanners, SSLyze and testssl.sh, connect to a service the way a client would and report which protocol versions, cipher suites, certificates and TLS weaknesses it actually offers. This guide shows infrastructure, PKI and vulnerability management teams how to run both tools safely, scan hundreds or thousands of endpoints, read the results against a published baseline and push the findings into change and remediation processes. Tools are listed alphabetically throughout; order is not a ranking. The baseline itself (which protocols and suites to allow) is covered in the TLS Server Configuration Baseline Guide; this page is about measuring against it.

This is an independent guide from NHI Mgmt Group, based on the SSLyze project documentation and the testssl.sh project documentation as of November 2026. It is not sponsored or reviewed by either project. Options change between releases, so confirm flags against each project's current documentation.

Key takeaways

  • Scan what clients see, not what config files say. Load balancers, CDNs, appliances and forgotten virtual hosts often negotiate settings nobody intended, and only a live handshake test shows them.
  • Pick the tool by job, or run both. SSLyze is a Python tool and library with a built-in pass or fail check against Mozilla's TLS profiles; testssl.sh is a Bash script with very broad checks, severity-rated output and HTTP header tests.
  • Write machine-readable output from day one. SSLyze --json_out and testssl.sh --jsonfile or --csvfile let you diff runs, raise tickets and trend progress instead of reading terminal colours.
  • Authorisation comes before the first packet. Scan only hosts you own or have written permission to test; third-party SaaS, CDNs and partner endpoints need the provider's agreement or their published testing policy.
  • Findings need owners and a fix path. Map each finding class (legacy protocol, weak suite, missing HSTS, broken chain) to a configuration change, a change ticket and a re-scan that proves closure.

What each tool does

Both tools test a single endpoint by opening many TLS connections with different parameters and recording what the server accepts. Neither needs credentials or an agent on the target. Both also test STARTTLS services.

SSLyze

SSLyze describes itself as a fast SSL/TLS scanning tool and Python library. It checks the certificate, cipher suites per protocol version, elliptic curves, session resumption, compression, TLS_FALLBACK_SCSV, extended master secret, early data in TLS 1.3, HTTP headers and several known TLS flaws such as Heartbleed, ROBOT and OpenSSL CCS injection. Each check is a named scan command, for example certificate_info, tls_1_0_cipher_suites, tls_1_3_cipher_suites, robot and http_headers. By default the command line tool compares the results with Mozilla's "intermediate" configuration and returns a non-zero exit code if the server is not compliant. You can switch the profile with --mozilla_config (modern, intermediate, old or disable) or supply your own JSON profile in Mozilla's format with --custom_tls_config. A documented Python API lets you call scans from your own code.

testssl.sh

testssl.sh is a command line tool that checks a service on any port for TLS and SSL protocols, cipher suites and cryptographic flaws. A default run covers protocols (SSLv2 through TLS 1.3, plus ALPN and HTTP/2), cipher categories, forward secrecy, server defaults and certificate details, HTTP headers such as HSTS and cookie flags, a long list of named vulnerabilities (Heartbleed, CCS injection, Ticketbleed, ROBOT, CRIME, BREACH, POODLE, SWEET32, FREAK, DROWN, LOGJAM, BEAST, LUCKY13, RC4 and others), client simulation and a rating that follows the SSL Labs rating guide. Its own documentation warns that a good grade is not necessarily good security, and that STARTTLS results are capped. Findings in file output carry a severity (LOW, MEDIUM, HIGH, CRITICAL, plus WARN for client-side scan problems) and, for vulnerabilities, CVE and CWE identifiers.

AttributeSSLyzetestssl.sh
RuntimePython package (pip), Docker image, Windows executableBash script on Linux, BSD, macOS, WSL, Cygwin or MSYS2; ships static OpenSSL helper binaries
Licence (per project repository)GNU AGPLGNU GPL v2
Target list input--targets_in file, one host:port per line--file (or -iL) file of testssl.sh command lines, serial or --parallel
Machine output--json_out FILE (or - for stdout), serialised ScanResult objects--jsonfile, --jsonfile-pretty, --csvfile, --htmlfile, or -oA for all formats
Baseline checkMozilla modern, intermediate or old, or a custom JSON profile; non-zero exit on failureSeverity per finding, rating, --severity filter for file output; exit codes report errors and ambiguous results
STARTTLS--starttls with protocol or auto (deduced from port)--starttls (smtp, imap, pop3, ldap, postgres, mysql and others) and --mx for a domain's mail servers
Library usePython API for scripted and serverless scansCommand line only; environment variables preset most options

Installing and running safely

Treat a TLS scanner as a security tool, not a utility anyone can point anywhere.

  • Authorisation: keep a written scope listing hostnames, IP ranges and ports, approved by the asset owner. For third-party services (SaaS, CDN edges, payment gateways, partner APIs) check the provider's testing policy or get written consent first. A TLS scan opens thousands of handshakes and may trip intrusion prevention or rate limiting. Record the scanner's source IP so the SOC can recognise it.
  • Pin versions: install SSLyze from PyPI into a virtual environment or run a pinned Docker tag; clone testssl.sh at a release tag rather than the development branch. Record the version in each report so results are reproducible.
  • Dedicated scan host: run from a hardened jump host or a CI runner in a known network segment, so internal and external views are both deliberate. A scan from inside the data centre may not see what the internet sees through a CDN or WAF.
  • Data handling: testssl.sh states that, apart from DNS lookups and optional revocation checks, it contacts no other hosts; SSLyze connects only to the targets you list. The output still contains your internal hostnames, IPs, certificate subjects and weaknesses, so store it as confidential vulnerability data.
  • Be polite to fragile targets: SSLyze --slow_connection reduces concurrent connections; testssl.sh --connect-timeout and --openssl-timeout stop hangs on filtered hosts. Schedule scans of embedded devices, OT gateways and old appliances in a maintenance window.
  • Client certificates: for services that require mutual TLS, SSLyze accepts --cert, --key and --pass. Use a dedicated, short-lived test certificate held in a secrets manager, never a production workload's identity. See the mTLS Guide.

Scanning at scale

A one-off scan of a website is easy. The value comes from a repeatable estate scan.

  1. Build the target list from inventory, not memory. Combine DNS zone exports, load balancer and ingress configurations, cloud listener inventories, certificate inventory and Certificate Transparency results for your domains. The Certificate Inventory Register Template and Certificate Transparency Monitoring Guide for Web Teams help here. Include non-HTTP ports: SMTP 25 and 587, IMAPS 993, LDAPS 636, RDP 3389, database ports and management interfaces.
  2. Test hostnames, not only IPs. Virtual hosts behind one IP can serve different certificates and settings. testssl.sh notes that a check against an IP address may not hit the intended virtual host; SSLyze lets you set the SNI value with --sni. Where a name resolves to several IPs, testssl.sh tests each address unless you set --ip=one.
  3. Split the run. For SSLyze, write host:port lines to a file and call --targets_in with --json_out and --quiet. For testssl.sh, write one command line per target into a file and use --file with --parallel and an output directory for --jsonfile. Batch by environment or owner so results route cleanly.
  4. Run internal and external passes. Internal scans find weak management interfaces and east-west services; external scans show what the internet negotiates through CDNs and WAFs.
  5. Store results centrally with timestamp and tool version, so runs can be diffed.

Interpreting results: protocols, ciphers, certificates

Read results against a named baseline. Three public references agree on the core points:

  • Protocols: RFC 8996 (BCP 195, March 2021) says TLS 1.0 and TLS 1.1 MUST NOT be used. RFC 9325 (BCP 195, November 2022) says implementations must not negotiate SSL 2.0, SSL 3.0, TLS 1.0 or TLS 1.1, must support TLS 1.2 and should support and prefer TLS 1.3. NIST SP 800-52 Rev. 2 requires US government servers to support TLS 1.2 with FIPS-based suites and TLS 1.3 by 1 January 2024; NIST has announced that a Rev. 3 draft will follow.
  • Cipher suites: RFC 9325 says NULL and RC4 suites and suites under 112 bits (including export suites) must not be negotiated, suites under 128 bits should not be, static RSA key transport and TLS 1.2 DHE suites should not be, and CBC suites should not be used unless Encrypt-then-MAC is negotiated.
  • Certificates: RFC 9325 sets RSA keys of at least 2048 bits, no SHA-1 or MD5 signatures and no curves under 224 bits. Check expiry, chain completeness, hostname match, trusted root and revocation information.
  • Mozilla profiles: the Mozilla server-side TLS guidelines (version 6.0 of the published JSON) define "modern" as TLS 1.3 only with ECDSA certificates and "intermediate" as TLS 1.2 and 1.3 with ECDSA or RSA, 2048-bit RSA and DH, OCSP stapling and an HSTS minimum age of 63072000 seconds (two years). The public guidance has moved to a community project at docs.tlsref.org.

How each tool presents this:

  • SSLyze: the compliance check prints "OK - Compliant" or "FAILED - Not compliant" with reasons such as tls_versions, ciphers, certificate_types or certificate_signatures. In JSON, each scan command has its own result node with accepted and rejected suites per protocol and the certificate deployments with trust store validation.
  • testssl.sh: on screen, colour shows good and bad; in flat JSON or CSV each finding is a record with an id, host, port, severity and finding, plus cve and cwe for vulnerabilities. The pretty JSON adds a header with command line, OpenSSL binary and version, and a footer with scan time.

Validate surprising results by hand with openssl s_client before raising a high priority ticket: a TLS-terminating middlebox or a scan client problem (testssl.sh reports these as WARN) can mislead.

Common findings and fixes

FindingWhy it mattersTypical fixVerify with
SSLv2, SSLv3, TLS 1.0 or TLS 1.1 acceptedProhibited by RFC 8996 and RFC 9325; enables downgrade (ATT&CK T1689) and legacy flaws such as POODLE and DROWNSet minimum protocol to TLS 1.2 on the server, load balancer or CDN profile; confirm client impact from logs firstSSLyze tls_1_0_cipher_suites and tls_1_1_cipher_suites empty; testssl.sh -p
RC4, 3DES, NULL, export or anonymous suitesBelow RFC 9325 strength floor; SWEET32 for 64-bit blocks; FREAK and LOGJAM for exportReplace the cipher string with the baseline list; remove legacy suites from appliance profilestestssl.sh -s, -W, -4; SSLyze per-version suite lists
No forward secrecy (static RSA key exchange)Recorded traffic can be decrypted if the key leaksPrefer ECDHE suites; drop TLS_RSA_* suitestestssl.sh forward secrecy section; SSLyze accepted suite names
CBC suites in TLS 1.2 without Encrypt-then-MACPadding oracle class (LUCKY13); RFC 9325 says should not usePrefer AEAD (AES-GCM, ChaCha20-Poly1305)testssl.sh -L; SSLyze suite list
Missing or short HSTSFirst request can be downgraded to HTTP; RFC 9325 says web servers should use HSTSAdd Strict-Transport-Security with a long max-age at the edge; consider preloadtestssl.sh -h; SSLyze http_headers
Incomplete chain or untrusted rootSome clients fail; others build a path and hide the problemServe the leaf and all intermediates, not the root; fix bundle orderSSLyze certificate_info validation; testssl.sh -S chain and trust results
Expiring, mismatched or SHA-1 certificate; RSA under 2048 bitsOutage risk and failed validationReissue through the certificate lifecycle process; automate renewalBoth tools' certificate sections
Known TLS library flaws (Heartbleed, ROBOT, CCS injection)Memory disclosure or key recoveryPatch or replace the TLS library or appliance firmware; rotate keys after Heartbleed exposuretestssl.sh -U; SSLyze heartbleed, robot, openssl_ccs_injection
No TLS_FALLBACK_SCSV or insecure renegotiationDowngrade and renegotiation abuse on older stacksUpgrade the TLS stack; once legacy versions are gone fallback matters lesstestssl.sh -Z, -R; SSLyze tls_fallback_scsv, session_renegotiation

For a retirement campaign across many systems, use the Weak Cipher and Legacy Protocol Retirement Playbook. HSTS rollout and preload are covered in HSTS and HSTS Preload, and chain and expiry problems in the Expired Certificate Outage Troubleshooting Guide.

Integrating with CI and reporting

The aim is a gate that stops new weak configurations and a report that shows old ones shrinking.

  • Pipeline gate with SSLyze: its documentation describes running it as a CI/CD step; a non-zero exit when a host fails the Mozilla profile or your custom JSON profile can fail the deployment. Keep the custom profile in version control next to the TLS baseline so policy and test change together.
  • Pipeline gate with testssl.sh: run targeted checks (-p, -s, -S, -h) against a staging endpoint, write --jsonfile with --severity HIGH and fail the job if any record remains. Its documented exit codes report errors and ambiguous results (with 50 to 200 reserved for vulnerability scoring), so parse the JSON for policy decisions rather than relying on exit code alone.
  • Ticketing: normalise both outputs into one record per host, port and finding ID, then deduplicate against open tickets. Route by the owner field from your inventory and attach the raw JSON as evidence.
  • Change process: protocol and suite removals change client compatibility. Use testssl.sh client simulation (-c) and server logs of negotiated versions to identify affected clients, raise a standard change and roll back by restoring the previous profile if a critical client fails.
  • Vulnerability management feed: send findings into the same queue and SLAs as other scanner output so TLS issues are not a side spreadsheet. See the Vulnerability Management Guide.

Metrics

  • Percentage of in-scope TLS endpoints scanned in the last 30 days.
  • Percentage of endpoints compliant with the chosen profile (internal and external reported separately).
  • Count of endpoints still accepting TLS 1.0 or 1.1, trended weekly.
  • Median days from finding to verified fix for HIGH and CRITICAL TLS findings.
  • Certificates expiring within 30 days that have no renewal ticket.

Framework mapping

FrameworkReferenceHow scanning supports it
NIST CSF 2.0PR.DS-02, ID.RA-01Evidence that data in transit is protected; vulnerabilities in assets identified and recorded
NIST SP 800-53 Rev. 5SC-8, SC-13, SC-17, CM-6, RA-5Transmission protection, cryptographic protection, PKI certificates, configuration settings, vulnerability scanning
CIS Controls v8.13.10, 7.5, 7.6Encrypt sensitive data in transit; automated internal and external vulnerability scans
ISO/IEC 27001:2022 Annex AA.8.8, A.8.9, A.8.24Technical vulnerabilities, configuration management, use of cryptography
MITRE ATT&CK v20T1557, T1689Weak TLS settings make adversary-in-the-middle and downgrade attacks easier

Common failure patterns

  • Scanning only the website. Mail, LDAP, VPN portals, management interfaces and APIs on non-standard ports keep legacy protocols for years because nobody lists them.
  • Scanning IPs without SNI. The default certificate on an IP is often not the one real clients see, so findings are wrong in both directions.
  • Chasing a grade. testssl.sh's own documentation warns that a good grade is not the same as good security; a profile check tied to your baseline is more useful than a letter.
  • Turning off TLS 1.0 without checking clients. Old terminals and partner integrations break, the change is rolled back and never retried.
  • Unauthorised third-party scans. Scanning a provider's shared edge without permission can breach their terms and trigger blocks; test your own origin and ask the provider for their TLS settings.
  • Results nobody owns. A monthly PDF of red findings without owners or tickets changes nothing.

Practitioner checklist

  • Write and approve a scanning scope, including third-party permission where needed, and register the scanner IP with the SOC.
  • Pin tool versions and record them in every result file.
  • Build the target list from DNS, load balancers, cloud listeners, certificate inventory and CT logs, including non-HTTP ports.
  • Scan by hostname with SNI and test every resolved IP.
  • Choose a baseline (Mozilla intermediate or your own) and encode it as an SSLyze custom profile or testssl.sh severity rules.
  • Emit JSON for every run and store it centrally with timestamps.
  • Map each finding class to a fix, an owner and a change ticket, and re-scan to close.
  • Add a TLS gate to deployment pipelines for internet-facing services.

Standards and references

Related NHI Mgmt Group resources: TLS Server Configuration Baseline Guide · TLS 1.2 vs TLS 1.3 · Weak Cipher and Legacy Protocol Retirement Playbook · Certificate Revocation Guide

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.