← TLS scanner
TLS·Guide
All tools

The TLS Scanner

A web version of testssl.sh: it connects to a server and reports which SSL/TLS versions and cipher suites it accepts, the weaknesses that implies, and its certificate. An interactive panel sends one ClientHello of your choosing and shows the handshake records. The page speaks SSL/TLS itself, in JavaScript (lib/crypto/tls); the local agent only opens the raw TCP socket and relays bytes.

This first version derives its findings from what the server accepts and from its certificate; it does not send malformed or intrusive probes (Heartbleed, CCS injection, ROBOT and the like are out of scope). TLS 1.3 is detected, but our stack negotiates a single TLS 1.3 suite (TLS_AES_128_GCM_SHA256), so individual TLS 1.3 suites are not enumerated.

Contents

  1. The TlsScanner library
  2. What the findings mean
  3. The agent, and how a probe works

1The TlsScanner library

lib/crypto/tls/tls-scan.js is a JavaScript module with no user interface, built on the TLS stack in the same folder (tls.js, tls-engine.js, ssl2.js, tls-common.js) and on lib/x509.js for the certificate. It is agent-agnostic: you give it a connect() that opens one transport, so it can run over an agent socket, an in-memory pipe (the self-test does this), or anything with the agent-socket shape.

import { TlsScanner } from "/lib/crypto/tls/tls-scan.js";

const scanner = new TlsScanner(() => agent.tcpConnect(host, port, 10000), {
    host: "example.com",        // the address dialled (used for certificate host checks)
    serverName: "example.com",  // the SNI to send (omitted for a bare IP)
    timeout: 10000,
});
const report = await scanner.scan(event => console.log(event.phase));
MethodWhat it does
scanner.scan(onEvent)The full scan. Resolves to a report { host, serverName, versions, suitesByVersion, certificate, findings, secureRenegotiation }. onEvent is called as it goes, with { phase, version, suite } (phase is "version", "versionDone", "suite", "suiteDone", "preference" or "renegotiation").
scanner.probe({ version, suites, serverName, alpn, trace })One handshake attempt at a single version, offering the suite ids in suites (all defined for the version when omitted). Resolves to { accepted, version, cipher, group, alpn, peerChain, alert, alertName, error, durationMs, records }. With trace: true, records is the handshake messages in order.
scanner.probeSsl2({ trace })An SSL 2.0 attempt: { accepted, version, cipherSpecs, specNames, exportSpecs, peerChain }.
TlsScanner.analyze(report)The findings implied by a report: [{ severity, id, title, detail }], worst first (severity is "high", "medium", "low", "info" or "good"). Pure; scan() calls it for you.
TlsScanner.suitesForVersion(version)The suite ids defined for a TLS version number, strongest families first.

A records entry (from a traced probe) is { dir: "out" | "in", type, typeName, version, length, hex, handshakes: [{ type, name, length }] } — one per TLS record, in the order it crossed the wire; a handshake record lists the messages it carried.

2What the findings mean

FindingWhy it matters
SSL 2.0 / SSL 3.0 enabledBoth are broken. SSL 2.0 enables DROWN; SSL 3.0 with a CBC suite enables POODLE. Disable them.
TLS 1.0 / 1.1 enabledDeprecated. A CBC suite over TLS 1.0 is the setting for BEAST. Prefer TLS 1.2 and 1.3.
RC4 acceptedRC4 has keystream biases that leak plaintext. Remove every RC4 suite.
3DES accepted (Sweet32)64-bit block ciphers are open to a birthday attack on long-lived connections.
Anonymous suitesDH_anon / ECDH_anon give no server authentication: trivial man-in-the-middle.
No forward secrecyStatic-RSA key exchange means one leaked private key decrypts all past traffic. Offer ECDHE.
No secure renegotiationA server that does not send renegotiation_info (RFC 5746) may be open to renegotiation-prefix injection.
Certificate problemsExpired or not-yet-valid, self-signed, a key below 2048-bit RSA, an MD5/SHA-1 signature, or a name that does not cover the host.

A finding comes from what the server accepted during the scan, so it is only as complete as the suites our stack can offer (the set in tls-common.js). Absence of a finding is not a certificate of safety.

3The agent, and how a probe works

The browser cannot open a raw TCP socket, so the local agent does — and only that. Set its address on the Settings page (start it with agent -port 8765 and paste the address it prints), then Connect to the agent on the scanner page.

Each probe is one fresh TCP connection. The scanner wraps the agent socket in a ByteStream and runs the TLS client for the chosen version, offering exactly the cipher suites under test; the engine reads options.cipherSuites. If the server completes the handshake, the suite (and version) is accepted and the negotiated details and certificate are read from the connection; if it answers with an alert, the suite is rejected. SSL 2.0 is handled by ssl2.js, which learns the server's version, certificate and cipher-specs. No part of this uses the agent for TLS — the agent only moves bytes.

// the scan primitive, in essence
const connection = await SslEngine.client(stream, version, { cipherSuites: [suiteId], serverName });
// resolved  → accepted: connection.version / connection.cipher / connection.peerChain
// TlsAlert  → rejected