tlsconf

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package tlsconf builds the TLS configuration for the agent's single listening port.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(cert tls.Certificate, clientCAs *x509.CertPool) *tls.Config

Build returns the TLS config for the agent's single listening port.

clientCAs is the agent's own certificate authority pool (internal/certs), used to verify a device's client certificate at the handshake. It is nil only in tests that do not exercise mTLS.

When clientCAs is non-nil the mode is VerifyClientCertIfGiven, deliberately NOT RequireAndVerifyClientCert. ClientAuth is a property of the LISTENER, settled during the TLS handshake, before any HTTP request line is parsed — Go's crypto/tls offers no per-route control. The agent must serve mTLS-protected routes and GET /v1/status, which carries no credential, on one port; RequireAndVerifyClientCert would terminate the status request at the handshake, making the endpoint unreachable in exactly the situation it exists to diagnose.

Authentication strength is unchanged by this. A presented certificate is still fully verified against clientCAs and a bad one is still rejected at the handshake. Only the enforcement point moves, from the handshake to the requireDevice middleware, and only for one allowlisted path.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL