Why it exists
A vehicle exchanges telemetry, diagnostic requests and service commands across networks it cannot fully trust. Cellular connectivity provides reachability, but an application still needs to know who is at the other end. Traffic also needs protection against reading and modification along the path.
Transport Layer Security (TLS) creates a protected channel between endpoints. It can connect a vehicle application to its backend or protect a service between vehicle computers. Its protection ends wherever the TLS connection terminates: a gateway that decrypts traffic becomes part of the trusted path.
What it is
TLS combines peer authentication, shared-key establishment and protection of application traffic. TLS 1.3 is defined by RFC 8446. In its usual certificate-based deployment, the server proves its identity. Mutual TLS (mTLS) also authenticates the client, allowing a backend to recognize a provisioned vehicle credential.
TLS normally operates above the Transmission Control Protocol (TCP). Datagram Transport Layer Security (DTLS) serves applications using the User Datagram Protocol (UDP). DTLS handles handshake loss and reordering, but does not make application datagrams reliably delivered.
Different protection layers cover different boundaries:
| Mechanism | Protection layer | Typical boundary and limitation |
|---|---|---|
| MACsec — Media Access Control Security | Ethernet link layer, L2 | Protects Ethernet traffic between configured MACsec peers; coverage depends on the switching design. |
| IPsec — Internet Protocol Security | Network layer, L3 | Protects IP traffic between hosts or security gateways; tunnel protection ends at the tunnel endpoint. |
| TLS / DTLS | Above transport, often called L4+ | Protects a connection or association between application endpoints; does not hide all network metadata. |
| SecOC — Secure Onboard Communication | Protocol data unit, PDU | Authenticates configured messages and checks freshness; does not provide payload confidentiality. |
These mechanisms can complement each other. Choose them from the required trust boundary, rather than treating encryption anywhere on the route as protection everywhere.
How it works
A typical certificate-based TLS 1.3 handshake follows the structure in RFC 8446:
- Agree on parameters. The client offers supported algorithms and a key share. The server selects compatible parameters and returns its key share.
- Establish shared secrets. Ephemeral Elliptic Curve Diffie–Hellman (ECDHE) lets both peers derive shared secrets without sending the secret itself. Fresh ephemeral keys provide forward secrecy: later theft of a certificate’s private key does not by itself reveal previously recorded sessions.
- Authenticate the exchange. The server sends its certificate chain and signs the handshake transcript. The client validates the chain, expected server identity, validity period and permitted certificate use. With mTLS, the server also requests and verifies client authentication.
- Confirm and protect. Finished messages authenticate the handshake transcript. Derived traffic keys protect application records using authenticated encryption with associated data (AEAD), which provides confidentiality and detects modification.
The certificate key authenticates the handshake; symmetric traffic keys protect the records. Possessing a certificate alone proves nothing without the corresponding private key.
For a vehicle-backend connection, the vehicle usually acts as the TLS client. The backend maps its authenticated credential to a vehicle identity and then applies permissions. A valid client certificate does not automatically authorize remote commands or diagnostic access.
Diagnostics over Internet Protocol (DoIP) can use TLS for its TCP diagnostic connection. Discovery traffic is outside that connection. Check ISO 13400-2 and the chosen vehicle profile for required behavior; TLS does not replace diagnostic authorization.
Scalable service-Oriented MiddlewarE over IP (SOME/IP) can carry communication over TCP or UDP. TLS can protect supported TCP connections; DTLS can protect supported UDP unicast associations. Check middleware integration and the AUTOSAR release: TLS 1.3 support must not be assumed from a generic “secure communication” setting. Ordinary TLS and DTLS associations do not directly solve multicast group protection.
Example certificate-based handshake without client authentication, resumption or early data; handshake messages after ServerHello are encrypted, and application traffic is shown after client Finished.
When to use it — and when not
Use TLS for vehicle-backend APIs, telemetry and supported diagnostic or service connections that need endpoint authentication and confidentiality. Use mTLS when both endpoints must authenticate through managed credentials.
Use DTLS when preserving datagram behavior matters and both endpoints support the required profile. The application must still handle missing, duplicated or late messages.
Do not expect TLS to protect data after decryption, secure a compromised endpoint or authenticate a control PDU across terminating gateways. SecOC may suit that message-level requirement. MACsec or IPsec may be more appropriate when protection must cover broader traffic without integration into every application.
Best practices
- Choose a complete cryptographic profile. In TLS 1.3, a cipher suite selects the AEAD algorithm and key-derivation hash. Key-exchange groups and signature algorithms are negotiated separately. Benchmark AES-GCM with hardware acceleration and ChaCha20-Poly1305 on the actual device; names alone do not predict performance.
- Make identity checks explicit. Configure trust anchors, expected server names and client credential mappings. Provide trustworthy time for certificate validation and a defined recovery path when credentials expire.
- Plan certificate pinning carefully. Pinning constrains accepted certificates or public keys beyond ordinary trust validation. Include replacement pins and a secure update path before deployment. Pinning one backend leaf certificate can break connectivity during renewal.
- Measure connection costs. Certificate parsing, signature operations, key agreement and buffering consume processor time and memory. Test cold startup, concurrent connections, weak cellular links and reconnect storms.
- Use resumption deliberately. RFC 8446 session tickets enable resumption using a pre-shared key derived from an earlier session. This can avoid certificate exchange and signature work, but adds ticket storage, secret protection and lifecycle handling. Resumption with fresh ECDHE still incurs key-agreement work.
- Restrict early data. RFC 8446 early data, commonly called 0-RTT, can be replayed. Keep state-changing operations out of it unless the application has an explicit replay-safe design.
Common pitfalls
- Accepting any trusted certificate without checking the intended peer identity.
- Treating mTLS authentication as permission to execute every application command.
- Assuming session resumption always preserves the original authentication policy; ticket acceptance must account for credential revocation and changed permissions.
- Disabling verification to work around an incorrect clock or incomplete certificate chain.
- Terminating TLS at the telematics control unit and assuming the remaining path to the central computer is covered.
- Forgetting that encrypted traffic still reveals connection metadata and requires an independent availability strategy.