1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

add must_staple option to cert. Default false (#502)

This commit is contained in:
Craig Peterson
2019-05-29 14:03:36 -04:00
committed by GitHub
parent 766773afa5
commit be5b588035

View File

@@ -20,9 +20,10 @@ import (
)
type CertConfig struct {
CertName string `json:"cert_name"`
Names []string `json:"names"`
UseECC bool `json:"use_ecc"`
CertName string `json:"cert_name"`
Names []string `json:"names"`
UseECC bool `json:"use_ecc"`
MustStaple bool `json:"must_staple"`
}
type Client interface {
@@ -103,7 +104,7 @@ func (c *certManager) IssueOrRenewCert(cfg *CertConfig, renewUnder int, verbose
var client *acme.Client
var action = func() (*acme.CertificateResource, error) {
return client.ObtainCertificate(cfg.Names, true, nil, true)
return client.ObtainCertificate(cfg.Names, true, nil, cfg.MustStaple)
}
if existing == nil {
@@ -125,7 +126,7 @@ func (c *certManager) IssueOrRenewCert(cfg *CertConfig, renewUnder int, verbose
} else {
log.Println("Renewing cert")
action = func() (*acme.CertificateResource, error) {
return client.RenewCertificate(*existing, true, true)
return client.RenewCertificate(*existing, true, cfg.MustStaple)
}
}
}