tlsconfig

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() fx.Option

Module is a fx module that constructs annotated instance of *tls.Config.

Types

type ClientTLSConfig

type ClientTLSConfig struct {
	CertFile           string `json:"cert_file" validate:"omitempty,file"`
	KeyFile            string `json:"key_file" validate:"omitempty,file"`
	CAFile             string `json:"ca_file" validate:"omitempty,file"`
	KeyLogWriter       string `json:"key_log_file" validate:"omitempty,file"`
	InsecureSkipVerify bool   `json:"insecure_skip_verify"`
}

ClientTLSConfig is the config for client TLS. swagger:model

func (*ClientTLSConfig) GetGRPCDialOptions

func (c *ClientTLSConfig) GetGRPCDialOptions(insecureEnabled bool) ([]grpc.DialOption, error)

GetGRPCDialOptions creates GRPC DialOptions for TLS.

func (*ClientTLSConfig) GetTLSConfig

func (c *ClientTLSConfig) GetTLSConfig() (*tls.Config, error)

GetTLSConfig initializes tls.Config from config options.

type Constructor

type Constructor struct {
	Name          string
	Key           string
	DefaultConfig ServerTLSConfig
}

Constructor holds fields to create an annotated instance of *tls.Config.

func (Constructor) Annotate

func (constructor Constructor) Annotate() fx.Option

Annotate creates an annotated instance of *tls.Config.

type ServerTLSConfig

type ServerTLSConfig struct {
	// Path to credentials. This can be set via command line arguments as well.
	CertsPath string `json:"certs_path"`
	// Server Cert file
	ServerCert string `json:"server_cert" default:"ca.crt"`
	// Server Key file
	ServerKey string `json:"server_key" default:"ca.key"`
	// Client CA file
	ClientCA string `json:"client_ca" validate:"omitempty"`
	// Allowed CN
	AllowedCN string `json:"allowed_cn" validate:"omitempty,fqdn"`
	// Enable TLS
	Enable bool `json:"enable" default:"false"`
}

ServerTLSConfig holds configuration for setting up server TLS support. swagger:model

Jump to

Keyboard shortcuts

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