acme

package
v2.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

Package acme abstracts away various ACME libraries

Index

Constants

View Source
const (
	LetsEncryptStagingCA    = "https://acme-staging-v02.api.letsencrypt.org/directory"
	LetsEncryptProductionCA = "https://acme-v02.api.letsencrypt.org/directory"
)

The Let's Encrypt ACME endpoints

Variables

View Source
var (
	// ErrProviderNotImplemented can be returned when attempting to
	// instantiate an unimplemented provider
	ErrProviderNotImplemented = errors.New("Provider not implemented")
)

Functions

This section is empty.

Types

type Option

type Option func(o *Options)

Option (or Options) are passed to New() to configure providers

func AcceptToS

func AcceptToS(b bool) Option

AcceptToS indicates whether you accept your CA's terms of service

func CA

func CA(CA string) Option

CA sets the CA of an acme.Options

func Cache

func Cache(c interface{}) Option

Cache provides a cache / storage interface to the underlying ACME library as there is no standard, this needs to be validated by the underlying implentation.

func ChallengeProvider

func ChallengeProvider(p challenge.Provider) Option

ChallengeProvider sets the Challenge provider of an acme.Options if set, it enables the DNS challenge, otherwise tls-alpn-01 will be used.

func OnDemand

func OnDemand(b bool) Option

OnDemand enables on-demand certificate issuance. Not recommended for use with the DNS challenge, as the first connection may be very slow.

type Options

type Options struct {
	// AcceptTLS must be set to true to indicate that you have read your
	// provider's terms of service.
	AcceptToS bool
	// CA is the CA to use
	CA string
	// ChallengeProvider is a go-acme/lego challenge provider. Set this if you
	// want to use DNS Challenges. Otherwise, tls-alpn-01 will be used
	ChallengeProvider challenge.Provider
	// Issue certificates for domains on demand. Otherwise, certs will be
	// retrieved / issued on start-up.
	OnDemand bool
	// Cache is a storage interface. Most ACME libraries have an cache, but
	// there's no defined interface, so if you consume this option
	// sanity check it before using.
	Cache interface{}
}

Options represents various options you can present to ACME providers

func DefaultOptions

func DefaultOptions() Options

DefaultOptions uses the Let's Encrypt Production CA, with DNS Challenge disabled.

type Provider

type Provider interface {
	// Listen returns a new listener
	Listen(...string) (net.Listener, error)
	// TLSConfig returns a tls config
	TLSConfig(...string) (*tls.Config, error)
}

Provider is a ACME provider interface

Directories

Path Synopsis
Package autocert is the ACME provider from golang.org/x/crypto/acme/autocert This provider does not take any config.
Package autocert is the ACME provider from golang.org/x/crypto/acme/autocert This provider does not take any config.
Package certmagic is the ACME provider from github.com/mholt/certmagic
Package certmagic is the ACME provider from github.com/mholt/certmagic

Jump to

Keyboard shortcuts

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