tls

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 4 Imported by: 0

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

View Source
const SharedPrefix = "server.tls"

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

func CertPool(caFiles ...string) (*x509.CertPool, error)

CertPool builds an x509 certificate pool seeded with the given PEM CA/cert files. Re-exported from gitlab.com/phpboyscout/go/tls.

func ClientConfig

func ClientConfig(caFiles ...string) (*cryptotls.Config, error)

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

func DefaultConfig() *cryptotls.Config

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

type Pair = gtls.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

func Resolve(cfg config.Reader, transportPrefix string) Pair

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.

Jump to

Keyboard shortcuts

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