Help us shape the future of Go! Take the 2026 Go Developer Survey

tlsutil

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Overview

Package tlsutil provides helper functions for TLS configuration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultClientConfig

func DefaultClientConfig(certPath, keyPath, caPath, serverName string) (*tls.Config, error)

DefaultClientConfig returns a secure default client TLS config

func DefaultServerConfig

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

DefaultServerConfig returns a secure default server TLS config

func LoadCACertPool

func LoadCACertPool(caPath string) (*x509.CertPool, error)

LoadCACertPool loads a CA certificate pool from a file

func LoadClientConfig

func LoadClientConfig(cfg Config) (*tls.Config, error)

LoadClientConfig loads TLS configuration for clients

func LoadServerConfig

func LoadServerConfig(cfg Config) (*tls.Config, error)

LoadServerConfig loads TLS configuration for servers

func TLSVersionFromString

func TLSVersionFromString(s string) uint16

TLSVersionFromString converts a string to TLS version

Types

type Config

type Config struct {
	CertPath   string
	KeyPath    string
	CAPath     string
	MinVersion uint16
	ServerName string
	ClientAuth tls.ClientAuthType
}

Config holds TLS configuration

Jump to

Keyboard shortcuts

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