go-micro: github.com/micro/go-micro/api/server/acme Index | Files | Directories

package acme

import "github.com/micro/go-micro/api/server/acme"

Package acme abstracts away various ACME libraries


Package Files

acme.go options.go


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

The Let's Encrypt ACME endpoints


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

type Option Uses

type Option func(o *Options)

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

func AcceptToS Uses

func AcceptToS(b bool) Option

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

func CA Uses

func CA(CA string) Option

CA sets the CA of an acme.Options

func Cache Uses

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 Uses

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 Uses

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 Uses

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 Uses

func DefaultOptions() Options

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

type Provider Uses

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


autocertPackage autocert is the ACME provider from golang.org/x/crypto/acme/autocert This provider does not take any config.
certmagicPackage certmagic is the ACME provider from github.com/caddyserver/certmagic

Package acme imports 4 packages (graph) and is imported by 9 packages. Updated 2020-07-31. Refresh now. Tools for package owners.