Documentation
¶
Overview ¶
Package tls is GTB's thin adapter over the standalone hardened-TLS module gitlab.com/phpboyscout/go/tls. It re-exports the module's core (the typed Pair, the hardened DefaultConfig, the ClientConfig/CertPool builders, and the pure ResolvePair merge) so existing GTB call sites are unchanged, and it retains the GTB-specific config-key adapter Resolve (plus SharedPrefix) that materialises a Pair from GTB configuration — the piece that cannot live in the framework-free module.
Index ¶
Constants ¶
SharedPrefix is the config prefix for TLS settings shared across every transport. A transport-specific prefix (e.g. "server.grpc.tls") overrides individual fields, so one certificate can serve all transports with per-transport overrides where needed. It is a GTB config-key convention, so it lives here with the Resolve adapter rather than in the config-agnostic module.
Variables ¶
This section is empty.
Functions ¶
func CertPool ¶
CertPool builds an x509 certificate pool seeded with the given PEM CA/cert files. Re-exported from gitlab.com/phpboyscout/go/tls.
func ClientConfig ¶
ClientConfig returns a hardened client TLS config that trusts the given CA/cert files (or the system roots when none are given). Re-exported from gitlab.com/phpboyscout/go/tls.
func DefaultConfig ¶
DefaultConfig returns the hardened TLS configuration shared across HTTP and gRPC servers and the HTTP client. Re-exported from gitlab.com/phpboyscout/go/tls.
Types ¶
type Pair ¶
Pair is the typed enabled/cert/key triple used to configure TLS for any transport. Re-exported from gitlab.com/phpboyscout/go/tls.
func Resolve ¶
Resolve resolves the TLS settings for a transport from GTB config. It starts from the shared SharedPrefix ("server.tls") and overrides each field individually from the transport-specific prefix (e.g. "server.grpc.tls", "server.http.tls", "server.gateway.tls") whenever that key is set.
func ResolvePair ¶ added in v0.30.0
func ResolvePair(shared, transport Pair, overrides PairOverrides) Pair
ResolvePair resolves TLS settings from already-materialised typed values, overriding individual fields of the shared pair when the transport section supplied them. Re-exported from gitlab.com/phpboyscout/go/tls.
type PairOverrides ¶ added in v0.30.0
type PairOverrides = gtls.PairOverrides
PairOverrides records which fields a transport-specific TLS section set, so ResolvePair can merge per-transport config without a config lookup interface. Re-exported from gitlab.com/phpboyscout/go/tls.