tlsutil

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCertPoolFromPEMFile

func LoadCertPoolFromPEMFile(path string) (*x509.CertPool, error)

LoadCertPoolFromPEMFile 从 PEM 文件加载证书池。

func MustServerConfig

func MustServerConfig(opts ServerConfigOptions) *tls.Config

MustServerConfig 构造服务端 TLS 配置,失败时 panic。

func NewClientConfig

func NewClientConfig(opts ClientConfigOptions) (*tls.Config, error)

NewClientConfig 构造客户端 TLS 配置。

func NewServerConfig

func NewServerConfig(opts ServerConfigOptions) (*tls.Config, error)

NewServerConfig 构造服务端 TLS 配置。

Types

type ClientConfigOptions

type ClientConfigOptions struct {
	CAPath             string
	CertPath           string
	KeyPath            string
	ServerName         string
	InsecureSkipVerify bool
	MinVersion         uint16
}

ClientConfigOptions 描述客户端 TLS 配置来源。

type ServerConfigOptions

type ServerConfigOptions struct {
	CertPath   string
	KeyPath    string
	MinVersion uint16
}

ServerConfigOptions 描述服务端 TLS 配置来源。

Jump to

Keyboard shortcuts

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