tls

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package tls provides self-signed TLS certificate generation and loading for DevClaw's HTTPS support. Uses Go's crypto/x509 stdlib (no OpenSSL dependency).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertExpiry

func CertExpiry(certPath string) (time.Time, error)

CertExpiry returns the NotAfter time of the certificate at certPath.

func CertFingerprint

func CertFingerprint(certPath string) (string, error)

CertFingerprint returns the SHA-256 fingerprint of the certificate at certPath as a lowercase hex string with colon separators (e.g. "ab:cd:ef:...").

func EnsureSelfSignedCert

func EnsureSelfSignedCert(certPath, keyPath string, logger *slog.Logger) error

EnsureSelfSignedCert checks if cert+key exist at the given paths. If not, generates new self-signed certificates using ECDSA P-256. Certificate validity: 10 years. File permissions: 0600.

func LoadTLSConfig

func LoadTLSConfig(certPath, keyPath string) (*tls.Config, error)

LoadTLSConfig reads the certificate and key files and returns a *tls.Config ready for use with http.Server. MinVersion is set to TLS 1.2.

Types

This section is empty.

Jump to

Keyboard shortcuts

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