tls

package
v2.25.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExpired

func IsExpired(validUntil int64) bool

IsExpired checks whether the revocation list is expired

Types

type CRLConfig

type CRLConfig struct {
	Enabled bool           `yaml:"enabled" json:"enabled"`
	HTTP    HTTPConfigurer `yaml:"http,omitempty" json:"http,omitempty"`
}

func (*CRLConfig) Equals

func (c *CRLConfig) Equals(c2 CRLConfig) bool

func (*CRLConfig) UnmarshalYAML

func (c *CRLConfig) UnmarshalYAML(value *yaml.Node) error

func (*CRLConfig) Validate

func (c *CRLConfig) Validate() error

type ClientConfig

type ClientConfig struct {
	CAPool          interface{}         `yaml:"caPool" json:"caPool" description:"file path to the root certificates in PEM format"`
	KeyFile         urischeme.URIScheme `yaml:"keyFile" json:"keyFile" description:"file name of private key in PEM format"`
	CertFile        urischeme.URIScheme `yaml:"certFile" json:"certFile" description:"file name of certificate in PEM format"`
	UseSystemCAPool bool                `yaml:"useSystemCAPool" json:"useSystemCaPool" description:"use system certification pool"`
	CRL             CRLConfig           `yaml:"crl" json:"crl"`
	// contains filtered or unexported fields
}

ClientConfig provides configuration of a file based Server Certificate manager. CAPool can be a string or an array of strings.

func (*ClientConfig) CAPoolArray

func (c *ClientConfig) CAPoolArray() ([]urischeme.URIScheme, error)

func (*ClientConfig) CAPoolFilePathArray

func (c *ClientConfig) CAPoolFilePathArray() ([]string, error)

func (*ClientConfig) Equals

func (c *ClientConfig) Equals(c2 ClientConfig) bool

func (*ClientConfig) Validate

func (c *ClientConfig) Validate() error

type HTTPConfig

type HTTPConfig struct {
	// MaxIdleConns controls the maximum number of idle (keep-alive)
	// connections across all hosts. Zero means no limit.
	MaxIdleConns int `yaml:"maxIdleConns" json:"maxIdleConns"`

	// MaxConnsPerHost optionally limits the total number of
	// connections per host, including connections in the dialing,
	// active, and idle states. On limit violation, dials will block.
	//
	// Zero means no limit.
	MaxConnsPerHost int `yaml:"maxConnsPerHost" json:"maxConnsPerHost"`

	// MaxIdleConnsPerHost, if non-zero, controls the maximum idle
	// (keep-alive) connections to keep per-host. If zero,
	// DefaultMaxIdleConnsPerHost is used.
	MaxIdleConnsPerHost int `yaml:"maxIdleConnsPerHost" json:"maxIdleConnsPerHost"`

	// IdleConnTimeout is the maximum amount of time an idle
	// (keep-alive) connection will remain idle before closing
	// itself.
	// Zero means no limit.
	IdleConnTimeout time.Duration `yaml:"idleConnTimeout" json:"idleConnTimeout"`

	// Timeout specifies a time limit for requests made by this
	// Client. The timeout includes connection time, any
	// redirects, and reading the response body. The timer remains
	// running after Get, Head, Post, or Do return and will
	// interrupt reading of the Response.Body.
	//
	// A Timeout of zero means no timeout.
	//
	// The Client cancels requests to the underlying Transport
	// as if the Request's Context ended.
	//
	// For compatibility, the Client will also use the deprecated
	// CancelRequest method on Transport if found. New
	// RoundTripper implementations should use the Request's Context
	// for cancellation instead of implementing CancelRequest.
	Timeout time.Duration `yaml:"timeout" json:"timeout"`

	TLS ClientConfig `yaml:"tls" json:"tls"`
}

func (*HTTPConfig) GetIdleConnTimeout

func (c *HTTPConfig) GetIdleConnTimeout() time.Duration

func (*HTTPConfig) GetMaxConnsPerHost

func (c *HTTPConfig) GetMaxConnsPerHost() int

func (*HTTPConfig) GetMaxIdleConns

func (c *HTTPConfig) GetMaxIdleConns() int

func (*HTTPConfig) GetMaxIdleConnsPerHost

func (c *HTTPConfig) GetMaxIdleConnsPerHost() int

func (*HTTPConfig) GetTLS

func (c *HTTPConfig) GetTLS() ClientConfig

func (*HTTPConfig) GetTimeout

func (c *HTTPConfig) GetTimeout() time.Duration

func (*HTTPConfig) Validate

func (c *HTTPConfig) Validate() error

type HTTPConfigurer

type HTTPConfigurer interface {
	GetMaxIdleConns() int
	GetMaxConnsPerHost() int
	GetMaxIdleConnsPerHost() int
	GetIdleConnTimeout() time.Duration
	GetTimeout() time.Duration
	GetTLS() ClientConfig

	Validate() error
}

Jump to

Keyboard shortcuts

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