certs

package
v0.0.0-...-435c516 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultConsoleConfigDir minio configuration directory where below configuration files/directories are stored.
	DefaultConsoleConfigDir = ".console"

	// CertsDir Directory contains below files/directories for HTTPS configuration.
	CertsDir = "certs"

	// CertsCADir Directory contains all CA certificates other than system defaults for HTTPS.
	CertsCADir = "CAs"

	// PublicCertFile Public certificate file for HTTPS.
	PublicCertFile = "public.crt"

	// PrivateKeyFile Private key file for HTTPS.
	PrivateKeyFile = "private.key"
)
View Source
const EnvCertPassword = "CONSOLE_CERT_PASSWD"

EnvCertPassword is the environment variable which contains the password used to decrypt the TLS private key. It must be set if the TLS private key is password protected.

Variables

View Source
var (
	// DefaultCertsDir certs directory.
	DefaultCertsDir = &ConfigDir{Path: getDefaultCertsDir()}
	// DefaultCertsCADir CA directory.
	DefaultCertsCADir = &ConfigDir{Path: getDefaultCertsCADir()}
	// GlobalCertsDir points to current certs directory set by user with --certs-dir
	GlobalCertsDir = DefaultCertsDir
	// GlobalCertsCADir points to relative Path to certs directory and is <value-of-certs-dir>/CAs
	GlobalCertsCADir = DefaultCertsCADir
)

Functions

func EnsureCertAndKey

func EnsureCertAndKey(clientCert, clientKey string) error

EnsureCertAndKey checks if both client certificate and key paths are provided

func GetAllCertificatesAndCAs

func GetAllCertificatesAndCAs() (*x509.CertPool, []*x509.Certificate, *xcerts.Manager, error)

GetAllCertificatesAndCAs returns all certs and cas

func GetTLSConfig

func GetTLSConfig() (x509Certs []*x509.Certificate, manager *xcerts.Manager, err error)

GetTLSConfig returns the TLS config for the server

func LoadX509KeyPair

func LoadX509KeyPair(certFile, keyFile string) (tls.Certificate, error)

LoadX509KeyPair - load an X509 key pair (private key , certificate) from the provided paths. The private key may be encrypted and is decrypted using the ENV_VAR: MINIO_CERT_PASSWD.

func MkdirAllIgnorePerm

func MkdirAllIgnorePerm(path string) error

MkdirAllIgnorePerm attempts to create all directories, ignores any permission denied errors.

func ParsePublicCertFile

func ParsePublicCertFile(certFile string) (x509Certs []*x509.Certificate, err error)

ParsePublicCertFile - parses public cert into its *x509.Certificate equivalent.

Types

type ConfigDir

type ConfigDir struct {
	Path string
}

ConfigDir - points to a user set directory.

func NewConfigDirFromCtx

func NewConfigDirFromCtx(ctx *cli.Context, option string, getDefaultDir func() string) (*ConfigDir, bool, error)

NewConfigDirFromCtx configuration for dir of certs

func (*ConfigDir) Get

func (dir *ConfigDir) Get() string

Get - returns current directory.

Jump to

Keyboard shortcuts

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