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:
@@ -23,6 +23,7 @@ type CertConfig struct {
|
|||||||
CertName string `json:"cert_name"`
|
CertName string `json:"cert_name"`
|
||||||
Names []string `json:"names"`
|
Names []string `json:"names"`
|
||||||
UseECC bool `json:"use_ecc"`
|
UseECC bool `json:"use_ecc"`
|
||||||
|
MustStaple bool `json:"must_staple"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Client interface {
|
type Client interface {
|
||||||
@@ -103,7 +104,7 @@ func (c *certManager) IssueOrRenewCert(cfg *CertConfig, renewUnder int, verbose
|
|||||||
var client *acme.Client
|
var client *acme.Client
|
||||||
|
|
||||||
var action = func() (*acme.CertificateResource, error) {
|
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 {
|
if existing == nil {
|
||||||
@@ -125,7 +126,7 @@ func (c *certManager) IssueOrRenewCert(cfg *CertConfig, renewUnder int, verbose
|
|||||||
} else {
|
} else {
|
||||||
log.Println("Renewing cert")
|
log.Println("Renewing cert")
|
||||||
action = func() (*acme.CertificateResource, error) {
|
action = func() (*acme.CertificateResource, error) {
|
||||||
return client.RenewCertificate(*existing, true, true)
|
return client.RenewCertificate(*existing, true, cfg.MustStaple)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user