mtls

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Listener = "listener"
	Client   = "client"
)

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

Types

type ClientConfig

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

func ReadConfig

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

ReadConfig - Load config into struct

func (*ClientConfig) Address added in v0.0.2

func (c *ClientConfig) Address() string

Jump to

Keyboard shortcuts

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