tls

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package tls provides TLS configuration utilities for client connections. It supports standard TLS, mutual TLS (mTLS), and attested TLS (aTLS).

Index

Constants

View Source
const AttestationReportSize = 0x4A0

Variables

View Source
var (
	ErrFailedToLoadClientCertKey = errors.New("failed to load client certificate and key")
	ErrFailedToLoadRootCA        = errors.New("failed to load root ca file")
)

Functions

This section is empty.

Types

type Result

type Result struct {
	Config   *tls.Config
	Security Security
}

Result contains the result of TLS configuration.

func LoadATLSConfig

func LoadATLSConfig(attestationPolicy, serverCAFile, clientCert, clientKey string) (*Result, error)

LoadATLSConfig configures Attested TLS. Parameters are passed individually to avoid circular dependencies with the clients package.

func LoadBasicConfig

func LoadBasicConfig(serverCAFile, clientCert, clientKey string) (*Result, error)

LoadBasicConfig loads standard TLS configuration (TLS/mTLS).

type Security

type Security int

Security represents the type of TLS security configuration.

const (
	WithoutTLS Security = iota
	WithTLS
	WithMTLS
	WithATLS
	WithMATLS
)

func (Security) String

func (s Security) String() string

String returns a human-readable representation of the security level.

Jump to

Keyboard shortcuts

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