Documentation ¶
Index ¶
- Variables
- type Config
- func (c *Config) CertDomains() ([][]string, error)
- func (c *Config) Domains() []string
- func (c *Config) GetCertFileName(domain string) (string, error)
- func (c *Config) GetKeyFileName(domain string) (string, error)
- func (c *Config) GetTLSPort(domain string) (int, error)
- func (c *Config) GetWebRoot(domain string) (string, error)
- func (c *Config) PublishFile(domain, path string, contents []byte) (string, error)
- func (c *Config) TestChallenge(domain string) error
- type ConfigSite
- type DomainError
- type FileError
- type Info
- type Manager
- func (m *Manager) CheckCert(now time.Time, chain []*x509.Certificate, domain string) (*Info, error)
- func (m *Manager) GetCertInfo(domain string, now time.Time) (*Info, error)
- func (m *Manager) InstallSelfSigned(domain string, notBefore, notAfter time.Time) error
- func (m *Manager) RenewCertificate(domains []string) error
Constants ¶
This section is empty.
Variables ¶
var PackageVersion = "seehuhn.de/go/acme"
PackageVersion gives the acme package name and version (updated in an init function).
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { AccountDir string ContactEmail string `yaml:",omitempty"` DefaultSiteKeyFile string `yaml:",omitempty"` DefaultSiteCertFile string `yaml:",omitempty"` DefaultWebRoot string `yaml:",omitempty"` Sites []*ConfigSite // contains filtered or unexported fields }
Config describes the certificate data for a web server, serving one or more domains.
func (*Config) CertDomains ¶ added in v0.5.0
CertDomains returns a list of certificates the Config describes. Each elements of the returned slice is a list of domain names to be used for a single certificate. The first domain name is the one which holds information about the key and certificate file names.
func (*Config) Domains ¶ added in v0.5.0
Domains returns all domain names in the configuration data.
func (*Config) GetCertFileName ¶
GetCertFileName returns the file name for the certificate `domain`.
func (*Config) GetKeyFileName ¶
GetKeyFileName returns the file name for the private key of `domain`.
func (*Config) GetTLSPort ¶ added in v0.5.3
GetTLSPort returns the TCP port where TLS connections using the site certificate can be made.
func (*Config) GetWebRoot ¶
GetWebRoot returns the path of directory which corresponds to the root of the file tree served for `domain`. Only paths starting with `/.well-known/acme-challenge/` are required to work.
func (*Config) PublishFile ¶ added in v0.5.0
PublishFile puts a file with the given contents on the web server. Returns the created file name (to be used when later removing the file) and an error, if any.
func (*Config) TestChallenge ¶ added in v0.5.0
TestChallenge tries to publish and read back a challenge response file for the given domain.
type ConfigSite ¶
type ConfigSite struct { Domain string TLSPort int `yaml:",omitempty"` // default is 443 UseKeyOf string `yaml:",omitempty"` KeyFile string `yaml:",omitempty"` CertFile string `yaml:",omitempty"` WebRoot string `yaml:",omitempty"` // contains filtered or unexported fields }
ConfigSite describes the certificate data for a single domain.
type DomainError ¶ added in v0.3.0
A DomainError indicates an error relating to a domain.
func (*DomainError) Error ¶ added in v0.3.0
func (err *DomainError) Error() string
func (*DomainError) Unwrap ¶ added in v0.5.0
func (err *DomainError) Unwrap() error
type FileError ¶
type FileError struct {
FileName, Problem string
}
FileError is used to report error conditions relating to files or directories.
type Info ¶
type Info struct { Cert *x509.Certificate Chains [][]*x509.Certificate IsValid bool IsMissing bool Expiry time.Time Message string }
Info contains information about a single certificate installed on the system.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager holds all state required to generate and/or renew certificates via an ACME server.
func NewManager ¶
NewManager creates a new certificate manager.
func (*Manager) CheckCert ¶ added in v0.5.1
CheckCert checks that the given certificate is valid for the given domain. This does not take revocations into account.
func (*Manager) GetCertInfo ¶
GetCertInfo returns information about a certificate managed by m.
func (*Manager) InstallSelfSigned ¶ added in v0.3.0
InstallSelfSigned installs a self-signed dummy certificate for a domain.
func (*Manager) RenewCertificate ¶
RenewCertificate requests and installs a new certificate for the given set of domains.