tlspin

package
v0.0.0-...-16aca47 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: GPL-2.0, GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package tlspin provides certificate-pinned HTTPS clients for Sable's local control plane. The operator API uses a self-signed certificate, so pinning the exact leaf certificate replaces public-CA validation without trusting an arbitrary process that happens to bind a loopback port.

Index

Constants

View Source
const FingerprintSize = sha256.Size

Variables

This section is empty.

Functions

func LoadFingerprint

func LoadFingerprint(path string) ([]byte, error)

LoadFingerprint reads a PEM certificate and returns the SHA-256 fingerprint of its first certificate.

func NewClient

func NewClient(expectedFingerprint []byte, timeout time.Duration) (*http.Client, error)

NewClient returns a TLS 1.3 HTTPS client that accepts only the expected leaf certificate fingerprint. Redirects are rejected so credentials and bearer tokens cannot be forwarded away from the pinned origin.

func NewClientFromCert

func NewClientFromCert(certPath string, timeout time.Duration) (*http.Client, error)

NewClientFromCert loads a certificate pin from certPath and constructs a pinned client.

Types

This section is empty.

Jump to

Keyboard shortcuts

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