probe

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chains

type Chains struct {
	// Verified contains the verified chains.
	// In most cases the entry 0 contains the peer certificate chain
	// and entry 1 the certificates including the root and the server.
	Verified [][]*x509.Certificate
	// Peer contains the peer certificate chain.
	Peer []*x509.Certificate
	// Longest contains the longest found chain.
	Longest []*x509.Certificate
	// LongestName contains the name of the chain that was the longest.
	// It is either Peer or Verified with its index.
	LongestName string
}

Chains contains the result of a connection probe to a server.

func (*Chains) FormatTemplate

func (c *Chains) FormatTemplate(tpl string) (string, error)

func (*Chains) String

func (c *Chains) String() string

String returns a formatted string.

type Option

type Option func(probe *Probe)

Option is an Option for the New function.

func WithInsecure

func WithInsecure(insecure ...bool) Option

WithInsecure allows unverified chains. The default for this option is true.

type Probe

type Probe struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Probe

New returns a new Probe with the given options set.

func (*Probe) CollectCerts

func (p *Probe) CollectCerts(hostPort string, opts ...Option) (*Chains, error)

CollectCerts resets the probe and collect the certs from the hostPort.

Jump to

Keyboard shortcuts

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