mtls

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(config *ClientConfig) (*grpc.ClientConn, error)

func GetGrpcOptions

func GetGrpcOptions(caCertificate []byte, certificate []byte, privateKey []byte, servername string) ([]grpc.DialOption, error)

func GetListeners

func GetListeners() ([]string, error)

func VerifyCertificate

func VerifyCertificate(caCertificate []byte, rawCerts [][]byte) error

VerifyCertificate - Verify a certificate

func WriteConfig

func WriteConfig(clientConfig *ClientConfig, clientType, name string) error

save config as yaml file

Types

type ClientConfig

type ClientConfig struct {
	Operator      string `json:"operator"` // This value is actually ignored for the most part (cert CN is used instead)
	LHost         string `json:"lhost"`
	LPort         int    `json:"lport"`
	Type          string `json:"type"`
	CACertificate string `json:"ca_certificate"`
	PrivateKey    string `json:"private_key"`
	Certificate   string `json:"certificate"`
}

func NewClientConfig

func NewClientConfig(host, user string, port, caType int, certs, privateKey, ca []byte) *ClientConfig

NewClientConfig - new config and save in local file

func ReadConfig

func ReadConfig(confFilePath string) (*ClientConfig, error)

ReadConfig - Load config into struct

Jump to

Keyboard shortcuts

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