You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a TLS handshake, if the peer certificate contains a certificate status PV name (stored in the custom OID 1.3.6.1.4.1.37427.1), the connection now waits for that PV to report VALID before allowing data operations. This implements the PVA TLS certificate status protocol, matching PVXS behaviour.
Behaviour
Scenario
Result
Status PV reports VALID within timeout
Connection proceeds normally
Status PV not confirmed within EPICS_PVA_CERT_STATUS_TMO (default 30 s)
Degraded mode: data operations released with a warning logged
Status PV reports REVOKED or EXPIRED
Connection is immediately shut down
Certificate has no status PV OID
No gating; connection proceeds immediately
Client side
ClientTCPHandler starts a CertificateStatusMonitor after a successful TLS handshake.
Data operations are gated on a CompletableFuture that resolves when the status PV responds.
The monitor uses a PVAClient(tls_disabled=true) to avoid infinite recursion (cert-status monitoring cannot itself require cert-status monitoring).
OCSP responses are tracked with expiry timers; when an OCSP response expires the connection re-validates.
Server side
ServerTCPListener and ServerTCPHandler start a CertificateStatusMonitor for the client certificate after TLS handshake.
CreateChannelHandler gates its reply on the client certificate status being VALID.
Configuration
Variable
Default
Description
EPICS_PVA_CERT_STATUS_TMO
30
Seconds to wait for cert status PV before entering degraded mode
Dependencies
This branch includes the prerequisite commits for XDG keychain discovery, keychain password file support, CA certificate extraction, and DER double-unwrap, since the certificate status monitor relies on SecureSockets and PVASettings helpers introduced in those changes. Those changes are also submitted as standalone PRs:
I would defer this because it is a significant change with no immediate need.
This Java implementation aims to be compatible with the C++ (PVXS) implementation. This includes the PVXS security additions which as of now have not been released. Java servers and clients can use the same certificates as PVXS servers and clients.
For a PVA server, it is essential to know the identity of the PVA client. That way, write access to PVs can be controlled based on the trusted client authentication. While the Java PVA server so far sees very little use (https://github.com/controlSystemStudio/pvaify is the only known utility that depends on it), the Java PVA server does already implement the client certificate verification based on optional CERT:STATUS:.. PVs provided by PVACMS.
For the client, there is no immediate need to verify the server identity because there is no mechanism to use that information. PV names are not tied to specific IOCs. Clients do not keep a white list of approved servers.
The client-side check of a server certificate should thus be delayed until the PVXS implementation settles into a release, and maybe even further until clients start to adopt mechanisms that require the server cert validation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
After a TLS handshake, if the peer certificate contains a certificate status PV name (stored in the custom OID
1.3.6.1.4.1.37427.1), the connection now waits for that PV to reportVALIDbefore allowing data operations. This implements the PVA TLS certificate status protocol, matching PVXS behaviour.Behaviour
VALIDwithin timeoutEPICS_PVA_CERT_STATUS_TMO(default 30 s)REVOKEDorEXPIREDClient side
ClientTCPHandlerstarts aCertificateStatusMonitorafter a successful TLS handshake.CompletableFuturethat resolves when the status PV responds.PVAClient(tls_disabled=true)to avoid infinite recursion (cert-status monitoring cannot itself require cert-status monitoring).Server side
ServerTCPListenerandServerTCPHandlerstart aCertificateStatusMonitorfor the client certificate after TLS handshake.CreateChannelHandlergates its reply on the client certificate status beingVALID.Configuration
EPICS_PVA_CERT_STATUS_TMO30Dependencies
This branch includes the prerequisite commits for XDG keychain discovery, keychain password file support, CA certificate extraction, and DER double-unwrap, since the certificate status monitor relies on
SecureSocketsandPVASettingshelpers introduced in those changes. Those changes are also submitted as standalone PRs:Files Changed
core/pva/src/main/java/org/epics/pva/PVASettings.javacore/pva/src/main/java/org/epics/pva/client/ClientTCPHandler.javacore/pva/src/main/java/org/epics/pva/common/CertificateStatus.javacore/pva/src/main/java/org/epics/pva/common/CertificateStatusMonitor.javacore/pva/src/main/java/org/epics/pva/common/SecureSockets.javacore/pva/src/main/java/org/epics/pva/server/CreateChannelHandler.javacore/pva/src/main/java/org/epics/pva/server/ServerTCPHandler.javacore/pva/src/main/java/org/epics/pva/server/ServerTCPListener.java