Skip to content

feat(ocpp-wamp): terminate TLS on the WebSocket server for security profiles 2 and 3 #155

Open

Description

@juherr

Context

Security profiles 2 and 3 of OCPP (OCPP 1.6 Security Whitepaper edition 3, OCPP 2.0.1 part 2 §A00) secure the
connection with TLS, the CSMS acting as the TLS server (A00.FR.306, A00.FR.409). Profile 3 also authenticates the
charging station with a TLS client certificate (A00.FR.401, A00.FR.402).

The WebSocket server of ocpp-wamp only opens a plain HTTP listener: Undertow.toServer calls addHttpListener
(source),
and nothing in the toolkit takes an SSLContext.

Problem

Proposed solution

  • An HTTPS listener for Undertow, OcppWampServer.asServer and the toolkit ServerSetting, built from an
    SSLContext the application provides, so that the key material stays with the application.
  • Client authentication requested rather than required, so that stations of profiles 2 and 3 can share a port and the
    decision stays with the authorizer.
  • The verified certificate chain of the station exposed on ConnectionRequest, which feat(ocpp-wamp)!: admit a charging station from its upgrade request headers #154 made a class for that
    purpose.

To settle: the TLS versions and cipher suites the toolkit enforces versus what it leaves to the SSLContext, and
whether the certificate forwarded by a TLS-terminating proxy is supported, for instance through an opt-in trusted
header.

Acceptance criteria

  • A CSMS can serve OCPP-J over wss:// from an SSLContext it provides, with ocpp-wamp alone and with the
    toolkit.
  • The client certificate chain of a station reaches the ConnectionAuthorizer through ConnectionRequest.
  • A station without a client certificate can still connect when the authorizer allows it.
  • Tests cover a wss:// connection with and without a client certificate.
  • The README shows how to enable TLS.

Out of scope

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions