tls

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTLSPort = 443

DefaultTLSPort is the well-known port for TLS (HTTPS).

View Source
const (
	ErrTLSHandshakeFailed greet.ErrorCode = "tls_handshake_failed"
)
View Source
const ProtocolName = "tls"

ProtocolName is the registered name for the TLS protocol.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertChainEntry

type CertChainEntry struct {
	Subject           string   `json:"subject"`
	Issuer            string   `json:"issuer"`
	Serial            string   `json:"serial"`
	NotBefore         string   `json:"not_before"`
	NotAfter          string   `json:"not_after"`
	Version           int      `json:"version"`
	DNSNames          []string `json:"dns_names,omitempty"`
	IPAddresses       []string `json:"ip_addresses,omitempty"`
	IsCA              bool     `json:"is_ca"`
	SignatureAlgo     string   `json:"signature_algo"`
	PublicKeyAlgo     string   `json:"public_key_algo"`
	SHA256Fingerprint string   `json:"sha256_fingerprint"`

	// Status holds Chrome-style CERT_ checks for this individual certificate.
	// ref: https://github.com/chromium/chromium/blob/main/net/cert/cert_status_flags.cc
	Status []string `json:"status"`
}

CertChainEntry holds the details of a single certificate in the chain.

type TLS

type TLS struct{}

TLS implements a TLS connectivity and certificate probe. It connects via TLS with InsecureSkipVerify, extracts the leaf certificate, and reports Chrome-style CERT_ status checks.

func (*TLS) DefaultPort

func (t *TLS) DefaultPort() int

func (*TLS) Description

func (t *TLS) Description() string

func (*TLS) Greet

func (t *TLS) Greet(ctx context.Context, host string, port int, opts ...greet.GreetOption) (*greet.GreetResult, error)

func (*TLS) Name

func (t *TLS) Name() string

func (*TLS) Transport

func (t *TLS) Transport() greet.Transport

type TLSResult

type TLSResult struct {
	// CertChain contains all presented certificates sorted from leaf to root.
	// The leaf certificate is always CertChain[0].
	CertChain []CertChainEntry `json:"cert_chain"`

	// Status is the final concluded chain status. It holds the statuses from
	// the first certificate (walking leaf→root) that has a non-OK check, or
	// ["OK"] if every certificate in the chain passes all checks.
	Status []string `json:"status"`
}

TLSResult holds the full certificate chain and the concluded chain status from a TLS handshake.

Jump to

Keyboard shortcuts

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