compat

package
v0.20.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSkipError

func IsSkipError(err error) bool

IsSkipError returns true if the error means the cert should be skipped over rather than being a fatal error

func ParseCertificate

func ParseCertificate(der []byte) (*x509.Certificate, error)

ParseCertificate parses a single certificate from the given ASN.1 DER data This is a wrapper for the x509.ParseCertificate function, handling the special case of a cert in a public trust bundle with a negative serial number which produces an error by default in Go 1.23. If using Go 1.22 or older, or if using Go 1.23 or newer and the GODEBUG value `x509negativeserial` is set to `1`, that specific cert will parse with no error. Otherwise, a special Error value will be returned so that the certificate can be skipped using IsSkipError

Types

type Error

type Error struct {
	Underlying error
	Message    string
}

Error is returned when there's a certificate compatibility error which implies that a certificate should be skipped

func (Error) Error

func (e Error) Error() string

func (Error) Unwrap

func (e Error) Unwrap() error

Jump to

Keyboard shortcuts

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