TLS in charging captures
What a capture of an encrypted session still shows, which checks apply, and how to get the messages decrypted.
What is visible without keys
- TLS 1.2: ClientHello, ServerHello, the charger's certificate chain, any CertificateRequest and plain alerts.
- TLS 1.3: ClientHello and ServerHello only. Certificates and everything else are encrypted.
- In both: how many application data records flowed, and how the TCP connection ended.
The verdict for such a session is Encrypted, not decrypted, with the version, suite and certificate it could read. A handshake cut short by a reset or an alert is a TLS failure instead.
Side channels
Many chargers keep other TLS connections open, for example to their backend on port 443, and reset them regularly. The checks only look at the connection that carries the session: the one where a V2G protocol was decoded, else the one to the address SDP announced, else the busiest encrypted one.
Decrypting with a key log
Drop the key log next to the capture. It is the NSS key log format (SSLKEYLOGFILE) that Wireshark, CANoe and dsV2Gshark read: one line per secret, CLIENT_RANDOM with the master secret for TLS 1.2, and the four traffic secrets for TLS 1.3. The file is recognised by its content, whatever it is called, and it never leaves the browser.
Some test systems disclose the secrets inside the capture instead, as a UDP datagram of key log lines sent right after the handshake. The dSPACE DS5366 does. Such a datagram shows as TLS key disclosure in the message table and is used like a key log file.
| Version | Suites decrypted |
|---|---|
| TLS 1.2 | AES-CBC with HMAC-SHA1, SHA-256 or SHA-384 (including the two ISO 15118-2 suites), AES-GCM, ChaCha20-Poly1305 |
| TLS 1.3 | TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256 |
Decrypted messages run through every check like a plain session. The TLS 1.3 certificates, encrypted on the wire, are read too, so PK-02 can check both chains of a mutual TLS session. The TLS tab lists the hellos, every handshake message and the chain with key usage and basic constraints.
TL-08 says when a key log does not fit: no secrets for this client random, secrets that do not authenticate the records, only part of the session decrypted, or a capture that starts after the handshake. The keys are matched by the client random, so the capture has to include the ClientHello.
A key log is written per session. Keep it with the capture it belongs to: a key log from the next plug-in opens nothing.
Sources
- RFC 5246, TLS 1.2
- RFC 8446, TLS 1.3
- NSS key log format