tlsconf

package
v0.0.0-...-7653185 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SubjectDNKnownAttributes = map[string]func(pkix.Name) []string{
	"C": func(n pkix.Name) []string {
		return n.Country
	},
	"O": func(n pkix.Name) []string {
		return n.Organization
	},
	"OU": func(n pkix.Name) []string {
		return n.OrganizationalUnit
	},
	"CN": func(n pkix.Name) []string {
		if n.CommonName == "" {
			return []string{}
		}
		return []string{n.CommonName}
	},
	"SERIALNUMBER": func(n pkix.Name) []string {
		if n.SerialNumber == "" {
			return []string{}
		}
		return []string{n.SerialNumber}
	},
	"L": func(n pkix.Name) []string {
		return n.Locality
	},
	"ST": func(n pkix.Name) []string {
		return n.Province
	},
	"STREET": func(n pkix.Name) []string {
		return n.StreetAddress
	},
	"POSTALCODE": func(n pkix.Name) []string {
		return n.PostalCode
	},
}

Functions

func BuildTLSConfig

func BuildTLSConfig(ctx context.Context, config *pldconf.TLSConfig, tlsType TLSType) (*tls.Config, error)

Types

type TLSConfigDetailed

type TLSConfigDetailed struct {
	TLSConfig   *tls.Config
	Certificate *tls.Certificate
}

func BuildTLSConfigExt

func BuildTLSConfigExt(ctx context.Context, config *pldconf.TLSConfig, tlsType TLSType) (*TLSConfigDetailed, error)

type TLSType

type TLSType string
const (
	ServerType TLSType = "server"
	ClientType TLSType = "client"
)

Jump to

Keyboard shortcuts

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