Reading a failed TLS handshake in ISO 15118-20
TLS 1.3 hides most of the handshake, but a failed one still tells you a lot: what the car offered, what the charger picked, who spoke last and who closed the connection. Then get the keys.
Less to see than you are used to
With ISO 15118-2 over TLS 1.2, a failed handshake is easy to read: the charger's certificate crosses the wire in the clear, and so does the alert that ends it. ISO 15118-20 runs only over TLS 1.3, and TLS 1.3 encrypts everything after the ServerHello: the charger's chain and its OCSP responses, the request for the vehicle certificate, the vehicle certificate itself, and any alert sent once the handshake keys are in place. Without keys, a capture shows two hellos, a few encrypted records and a closed connection.
That is less than you are used to, but it is not nothing. Read what is visible first, and only then reach for the key log.
Start with the ClientHello
The ClientHello is the car's statement of what it can do, and clause 7.7.3 of ISO 15118-20 says a good deal about what it has to contain. TL-05 checks it point by point:
- supported_versions lists TLS 1.3.
- The cipher suites TLS_AES_256_GCM_SHA384 and TLS_CHACHA20_POLY1305_SHA256.
- The groups secp521r1 and x448, with a key share for them.
- The signature algorithms ecdsa_secp521r1_sha512 and ed448.
- status_request, so that the charger staples OCSP responses, and certificate_authorities with the V2G roots the car trusts.
A car that leaves TLS 1.3 out of its hello is asking for ISO 15118-2 over TLS 1.2, whatever it says later in the app handshake. A car that offers ISO 15118-20 over plain TCP, as benches do so the messages stay readable, gets a warning from HS-03: fine on a bench, a finding in the field.
Then the ServerHello, or its absence
- No ServerHello, but an alert straight after the ClientHello: the charger found nothing it could accept. That alert is still readable, because no keys exist yet. handshake_failure (40) or protocol_version (70) usually mean a TLS library built without the version, groups or suites the car asks for.
- A HelloRetryRequest: the charger wants a group the car listed but sent no key share for. Legal, but it costs a round trip; TL-06 checks what the charger picked.
- A ServerHello with a suite or group outside Tables 6 and 7 is a finding for TL-06. It also means the car offered it: two default configurations agreeing with each other.
After the ServerHello: who spoke last
Once the ServerHello is through, the content is encrypted but the traffic pattern is not. The direction, size and order of the records stay visible in the TCP/TLS lane, and they are often enough to say which side gave up.
- The charger sends its encrypted flight, and the car closes or resets the connection without sending anything of its own: the car did not like what it got. Suspect the charger's chain (a root the car does not hold, a missing sub-CA, a certificate over the 1600 bytes V2G20-1234 allows) or its stapled OCSP responses, which expire and have to be renewed.
- The car answers with its own encrypted flight, and then the charger closes: the charger did not accept the vehicle certificate. Check that the charger holds the root of the car's chain.
- Everything completes and application data flows, then the session ends: not a TLS problem. The verdict reads Encrypted, not decrypted, and the question moves on to the messages.
Clocks deserve a line of their own. A car whose clock was reset believes every certificate is not yet valid, and a charger with a wrong clock staples responses that look stale to the car. Both fail the handshake with perfectly good certificates. Certificate lifecycle: validity, renewal and revocation has the details.
Then get the keys
Reasoning from traffic patterns gets you a suspect, not proof. The proof is in the decrypted handshake. Export a key log from the stack you control, in the NSS format that Wireshark also reads, and load it with the capture. For TLS 1.3 the key log holds the handshake secrets as well as the traffic secrets, and the handshake secrets are what open the certificates, the CertificateRequest and the alert. TL-08 says whether the key log opened the session, and with the chains readable PK-02 checks both of them.
If neither stack can export its keys, fix that before the next test campaign. A test system that discloses the secrets inside the capture saves the step entirely. TLS in charging captures describes both ways.
Bench habits that cause it
- Test roots on one side and production roots on the other: a classic reason for unknown_ca. The tls-fail demo shows the TLS 1.2 version of the same fault, where the alert is still readable.
- OCSP responses fetched once when the bench charger was set up, and never again.
- Certificates made with general purpose PKI tooling: GeneralizedTime before 2050, unexpected critical extensions, sizes over the limit.
- TLS switched off to read the messages on the bench, then switched on for the field without a test in between.
ISO 15118-20: TLS 1.3 and certificates lists the requirements behind every check named here, and The TLS handshake fails maps each alert to its usual causes.