Open Charging Technology · Whitepapers

TLS Client/Server Configuration for OCPP v2.x+

The current OCPP client configuration model for Charging Stations or Local Controllers connecting to the CSMS lacks the flexibility to specify detailed Transport Layer Security (TLS) parameters and options. For Local Controllers acting as OCPP HTTP Web Socket servers, OCPP does not define any mechanism to configure its TLS listener at all, making secure multi-hop communication effectively unsupported. This gap also extends to other OCPP-related network components such as OCPP Gateways deployed within a CPO infrastructure.

Beyond the core OCPP communication channel, several other use cases rely on additional protocols that must also support fine-grained TLS configuration:

Furthermore, many of these endpoints will require support for high-availability, redundancy and failover. This means that multiple endpoints (e.g., firmware servers in different availability zones) must be configurable, each potentially with unique certificates, trust anchors, and supported cipher policies. The current OCPP data model is insufficient to describe such topologies.

1. Requirements

The following requirement for the configuration of TLS clients and servers are based on:

1.1 Multiple TLS Engines

Not every TLS feature or extension is universally supported across all libraries. To maximize interoperability and ensure both client and server can negotiate at least a secure, mutually acceptable baseline, it’s best to architect your system so that multiple TLS engines can be used interchangeably.

1.2 Supported TLS Versions

A client/server should be able to use one or more TLS version, e.g. TLS v1.2 and TLS v1.3. To inhibit downgrade attacks it might also be beneficial when support of e.g. TLS v1.2 can be deactivated. For better compatibility the configured list of TLS versions should be a priority list, even when some implementations will ignore the order of versions.

1.3 Supported TLS Ciphers

A client/server should be able to use TLS ciphers depending on its risk profile and hardware constraints. For better compatibility the configured list of TLS ciphers should be a priority list, even when some implementations will ignore the order of ciphers.

The firmware should provide a list of available ciphers, but it is important to understand, that this list depends on the allowed TLS versions.
The values should be implemented as predefined strings to simplify updates.

Note: Should version and cipher be a JSON hierarchy?

1.4 Supported Signature Algorithms

1.5 Supported Compression Methods

1.6 RootCAs

1.7 Mutual TLS with Self-Signed Certificates

Some smart home protocols like EEBus use TLS, but without a Public Key Infrastrucrture (PKI). They use external methods to "pair" two devices and then "pin" the certificates. Crypto Agility is achieved by "re-pairing" both devices. For some use cases this might also be a valid option, e.g. for Charging Station to Local Controller communication.

1.8 Certificate "Pinning"

1.9 Notification on Certificate Changes

1.10 TLS Client Crypto Key Settings

1.11 TLS Certificate Checks

1.12 TLS Online Certificate Status Protocol

1.13 TLS Session Settings

1.14 TLS Application‑Layer Protocol Negotiation

The ALPN extension (RFC 7301) allows clients and servers to negotiate the application-layer protocol (like HTTP/1.1, HTTP/2, ...) during the initial TLS handshake.

1.15 (Encrypted) Server Name Indication

TLS servers and clients should support Server Name Indication (SNI) and optional (Encrypten) Server Name Indication (ESNI).

1.16 Heartbeat Extension

The Heartbeat Extension gives you a protocol‑level ping over TLS itself. It is negotiated in the handshake, sent in its own record type, echoing back arbitrary payloads—so you can keep connections alive and verify peer liveness without renegotiation or external timers.

Same idea as OCPP heart beats or HTTP WebSocket Pings, but at TLS, not at OCPP request/response or HTTP WebSocket level. Similar as HTTP WebSocket Pings not end-to-end like OCPP heart beats.

This extension is not widely supported within TLS libraries.

1.17 Signed Certificate Timestamp Extension

TLS Extension 18: Provides Signed Certificate Timestamps (SCTs) for Certificate Transparency logging.

1.18 TLS Buffer Size

A client/server should be able to configure its internal buffer size for cryptographic operations. For embedded devices this can save RAM, for bigger machines this can improve network througput in combination with Ethernet Jumpo Frames / Maximum Transfer Unit and larger TCP Maximum Seqment Size settings.

Buffer sizes must align with TLS record limits to avoid overflows or errors like "record_overflow" alerts; misconfiguration can lead to vulnerabilities if buffers are too small for certain operations like renegotiation.

1.19 MaxFragmentLength / RecordSizeLimit Extension

The max_fragment_length TLS v1.2 extension (extension type 1, RFC 6066 obsoleting RFC 3546) enables clients and servers to negotiate a smaller maximum plaintext fragment length for TLS records than the default of 214 bytes (16,384 bytes), which is particularly useful in constrained environments where devices have limited memory or bandwidth. Only sizes of 29(1), 210(2), 211(3), 2^12(4) are allowed.

The record_size_limit TLS v1.3 extension (extension type 28, RFC 8449) offers more flexibility: asymmetric limits (different send/receive sizes), values up to the protocol maximum (2^14+1 bytes), and no fixed enum—endpoints advertise a 16-bit integer for the max plaintext size they will receive.

If both extensions are present in a handshake, clients should abort with a fatal error to avoid conflicts.

1.20 Padding Extension

The padding TLS extension (extension type 21) adds padding to handshake messages to obscure message lengths and therefore helps to mitigate traffic analysis.

1.21 Connection Timeout

Waiting time until giving up or retry.

1.22 Retry Behavior

1.23 Limit Transfer Speed

Limit the speed of a connection.

1.24 DNS Servers to use

Which DNS servers should be used for this connection. System defaults otherwise.

1.25 IPv4 vs. IPv6

1.26 TCP-KeepAlive, FastOpen, NoDelay

1.27 Key types

1.28 Follow HTTP Redirects

1.29 Concurrent TLS connections

1.30 HTTP Server Name

1.31 HTTP User Agent

1.32 Logging and Tracing

Enable logging of all messages:

1.33 PreShared Keys (limited)

Client and server share a symmetric key ahead of time. TLS_PSK_* and TLS_ECDHE_PSK_* suites (RFC 4279, RFC 8446).

Warning: Limited library support!

1.34 Raw Public Key (limited)

Instead of full X.509 certificates, you use bare public keys (e.g. an EC point) carried in a lightweight TLS extension (RFC 7250).

Warning: Limited library support!

1.35 TLS Secure Remote Password (experimental)

TLS Secure Remote Passwords (RFC 5054) lets client and server prove to one another that they share a secret (your password) without ever sending the password in the clear, and without relying on certificates. Instead of verifying a server’s X.509 cert, you perform an SRP handshake in which both sides compute a shared key derived from your password and ephemeral values.

Warning: Weak library support!

1.36 Delegated Credentials (experimental)

Delegated Credentials (or "token‑bound credentials” or just "DCs") are a mechanism to allow a TLS server to “delegate” short‑lived signing authority to a separate key, without touching its long‑term private key or issuing a new certificate. Delegated Credentials are standardized in RFC 9345 and are being rolled out in large‑scale deployments (e.g., CDNs) to improve key agility and limit the blast radius of key compromise..

Long‑lived certificates (e.g. 90 days or more) require frequent reissuance to rotate keys. Delegated Credentials let you rotate the signing key on a much shorter schedule (hours), without issuing a new CA‑signed certificate each time.

Delegated Credentials ensure that your certificate’s long‑term private key is never used on the edge or CDN at all—only short‑lived “delegated” keys are. If a delegated‐credential key is stolen, its maximum validity (e.g. 6 h) bounds the attacker’s window; your true certificate key remains safely offline.

With Delegated Credentials, leakage of an edge’s delegated key only affects that key’s brief lifetime; you simply stop serving it and issue a fresh DC without touching your origin certificate.

Note: Perfect Forward Security rotates session keys so that adversaries can’t retroactively decrypt old sessions. Delegated Credentials do not copy the long-term private key on e.g. edge servers, only delegates short-lived private keys do. So both solve two different threat models, and they’re complementary rather than interchangeable.

Warning: Weak library support!

1.37 Subject Alternative Names within X.509 Certificates

1.38 DNS‑Based Authentication of Named Entities

DNS‑Based Authentication of Named Entities (DANE, RFC 7671) is a framework that lets domain owners assert which TLS certificates or public keys are valid for their services via DNS, secured by DNSSEC, rather than relying solely on external Certificate Authorities.

# Extract the SubjectPublicKeyInfo (SPKI) in DER form:
openssl x509 -in server.pem -noout -pubkey \
  | openssl pkey -pubin -outform der \
  > spki.der

# Compute the SHA‑256 digest of that DER blob, in hex:
openssl dgst -sha256 -binary spki.der | xxd -p -c 256
# → e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

DNS Record:

_443._tcp.www.example.com.  3600  IN  TLSA  3 1 1 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Breakdown of the fields (RFC 6698):

"PKIX" stands for Public Key Infrastructure with X.509 certificates.

DANE‑aware TLS clients will now do:

  1. Fetch _port._transport.name TLSA via DNSSEC.
  2. Validate DNSSEC proofs (RRSIG).
  3. During the TLS handshake, compares the server’s certificate or public key per the TLSA tuple (usage, selector, matching).
  4. Enforces the pinning rules (e.g. reject if no matching TLSA).

Note: SRV+TLSA (RFC 7673): Use TLSA with SRV‑discovered services (e.g. XMPP, SIP).

1.39 DNS-Service Records

A DNS SRV (“service”) record lets you publish the location (hostname and port) of servers for a given service and protocol under your domain. It’s defined in RFC 2782 and has these fields:

_service._proto.name. TTL  CLASS  SRV  priority  weight  port  target

; _ocpp._tcp.example.com SRV records for OCPP pool
_ocpp._tcp.example.com. 3600 IN SRV 10 60 5060 ocpp1.example.com.
_ocpp._tcp.example.com. 3600 IN SRV 10 20 5060 ocpp2.example.com.
_ocpp._tcp.example.com. 3600 IN SRV 10 20 5060 ocpp3.example.com.
_ocpp._tcp.example.com. 3600 IN SRV 20  0 5060 ocpp-fallback.example.com.
Field Type Description
service String The symbolic name of the service, prefixed with an underscore. Examples: _sip, _ldap, _xmpp-server, _kerberos.
proto String The transport protocol, also prefixed with an underscore: usually _tcp or _udp.
name String The domain under which you’re publishing.
TTL UInt32 Time‑to‑live in seconds for this record.
CLASS String Almost always IN for Internet.
SRV String The record type.
priority UInt16 Lower values mean higher preference. A client MUST try all records of the lowest-numbered priority first.
weight UInt16 Relative weight for records with the same priority. Clients use this for load balancing: If there are N records at the same priority, each has a chance proportional to its weight. A weight of 0 still participates (but only if all weights are 0, clients SHOULD pick randomly).
port UInt16 TCP or UDP port on which the service is running on the target host.
target String The canonical hostname of the machine providing this service. MUST not be “.” for service records.
  1. Construct the query Client looks up _service._proto.name (e.g. _ldap._tcp.dc.example.com).
  2. Sort by priority Group records by ascending priority. Start with the lowest.
  3. Select by weight Within that priority group, select one record via a weighted random algorithm: 3.1 Sum all weights W (should be 100, to keep it simple). 3.2 Generate a random number R in [0, W). 3.3 Walk the records, subtracting each record’s weight from R; when R < 0, choose that record.
  4. Attempt connection Connect to the selected record’s target on its port. If it fails, retry with the same priority group (re‑running the weighted selection among the remaining records). Only when all records of that priority fail does the client move to the next‑higher priority.

2. Regulatory Cybersecurity Requirements

The following requirments are grounded in applicable cybersecurity regulations and in other predominantly horizontal cybersecurity standards.

2.1 CEN, CENELEC and ETSI Work Programme

The following requirements are based on horizontal requirements coming from EU CRA, EU RED, EN 18031, ...

2.2 Minimal Attack Surface

2.3 Secure Defaults

2.4 Crypto Agilty


ToDo's:

...