selfsignedtlsgo

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 7 Imported by: 1

README

selfsigned-tls-go

⚠️ Only use for testing purposes!

Generates self-signed TLS certificate in-memory that can be used for HTTPS servers

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultSelfsignedTls

func DefaultSelfsignedTls() (tls.Certificate, error)

DefaultSelfsignedTls uses DefaultConfig to generate a self-signed tls.Certificate

func NewSelfsignedTls

func NewSelfsignedTls(cfg *Config) (tls.Certificate, error)

NewSelfsignedTls expects a Config to generate a self-signed tls.Certificate

Types

type Config

type Config struct {
	CommonName         string
	Country            string
	Organization       string
	OrganizationalUnit string
	ExpiryDays         int
	SubjectKeyId       []byte
}

Config allows the self-signed certificate to be customized

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig is useful for testing

Jump to

Keyboard shortcuts

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