ssl

package
v1.2.50 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterConfig

func RegisterConfig(kind string, config Config)

Types

type ClientConfig

type ClientConfig struct {
	InsecureSkipVerify bool     `json:"insecureSkipVerify"`
	Keypair            Keypairs `json:"keypair"`
}

func (*ClientConfig) Config

func (config *ClientConfig) Config() (gm *tlcp.Config, standard *tls.Config, err error)

type Config

type Config interface {
	Construct(options configures.Config) (err error)
	Server() (srvTLS *tls.Config, ln ListenerFunc)
	Client() (cliTLS *tls.Config, dialer Dialer)
}

func GetConfig

func GetConfig(kind string) (config Config, has bool)

type DefaultConfig

type DefaultConfig struct {
	// contains filtered or unexported fields
}

func NewDefaultConfig added in v1.1.3

func NewDefaultConfig(srv *tls.Config, cli *tls.Config, srvGM *tlcp.Config, cliGM *tlcp.Config) *DefaultConfig

func (*DefaultConfig) Client

func (config *DefaultConfig) Client() (cliTLS *tls.Config, dialer Dialer)

func (*DefaultConfig) Construct added in v1.2.6

func (config *DefaultConfig) Construct(options configures.Config) (err error)

func (*DefaultConfig) Server

func (config *DefaultConfig) Server() (srvTLS *tls.Config, ln ListenerFunc)

type DefaultConfigOptions

type DefaultConfigOptions struct {
	CA     []string      `json:"ca"`
	Server *ServerConfig `json:"server"`
	Client *ClientConfig `json:"client"`
}

func (DefaultConfigOptions) Build

func (options DefaultConfigOptions) Build() (srvGmTLS *tlcp.Config, cliGmTLS *tlcp.Config, srvStdTLS *tls.Config, cliStdTLS *tls.Config, err error)

type Dialer

type Dialer interface {
	DialContext(ctx context.Context, network, addr string) (net.Conn, error)
}

type Keypair

type Keypair struct {
	Cert     string `json:"cert"`
	Key      string `json:"key"`
	Password string `json:"password"`
}

type Keypairs

type Keypairs []Keypair

func (Keypairs) Certificates

func (kps Keypairs) Certificates() (tlcps []tlcp.Certificate, standards []tls.Certificate, err error)

type ListenerFunc

type ListenerFunc func(inner net.Listener) (ln net.Listener)

type SSCConfig

type SSCConfig struct {
	// contains filtered or unexported fields
}

func (*SSCConfig) Client

func (config *SSCConfig) Client() (cliTLS *tls.Config, dialer Dialer)

func (*SSCConfig) Construct added in v1.2.6

func (config *SSCConfig) Construct(options configures.Config) (err error)

func (*SSCConfig) NewListener

func (config *SSCConfig) NewListener(inner net.Listener) (ln net.Listener)

func (*SSCConfig) Server

func (config *SSCConfig) Server() (srvTLS *tls.Config, ln ListenerFunc)

type SSCConfigOptions

type SSCConfigOptions struct {
	CA                 string `json:"ca"`
	CAKEY              string `json:"caKey"`
	ClientAuth         string `json:"clientAuth"`
	ServerName         string `json:"serverName"`
	InsecureSkipVerify bool   `json:"insecureSkipVerify"`
}

func (*SSCConfigOptions) ClientAuthType added in v1.2.0

func (opt *SSCConfigOptions) ClientAuthType() tls.ClientAuthType

type ServerConfig

type ServerConfig struct {
	ClientAuth int      `json:"clientAuth"`
	Keypair    Keypairs `json:"keypair"`
}

func (*ServerConfig) Config

func (config *ServerConfig) Config() (gm *tlcp.Config, standard *tls.Config, err error)

Jump to

Keyboard shortcuts

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