tlsc

package
v0.0.0-...-baf2d7e Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config(options Options) (*tls.Config, error)

Config 返回一个可以被客户端使用tls配置

func ConfigDefault

func ConfigDefault(ops ...func(*tls.Config)) *tls.Config

ClientDefault 返回一个默认的tls配置

func SystemCertPool

func SystemCertPool() (*x509.CertPool, error)

SystemCertPool 返回系统的证书池

Types

type Options

type Options struct {
	CAFile string

	// 文件路径,不能为空
	CertFile string
	KeyFile  string

	// 如果该值为true并且CAFile存在的话,那么用于tls组件的root pool将使用CAFile中的roots
	// 否则使用系统的pool
	ExclusiveRootPools bool
	MinVersion         uint16
}

Options 用来创建tls客户端的配置信息

Jump to

Keyboard shortcuts

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