aboutsummaryrefslogtreecommitdiff
path: root/provider.go
diff options
context:
space:
mode:
Diffstat (limited to 'provider.go')
-rw-r--r--provider.go20
1 files changed, 17 insertions, 3 deletions
diff --git a/provider.go b/provider.go
index 3334ced..e22ffb6 100644
--- a/provider.go
+++ b/provider.go
@@ -299,7 +299,7 @@ func (p *Provider) queryStatus(url string) (bool, error) {
return r.Status == StatusValid, nil
}
-func (p *Provider) Cert(s Signer, altnames []string, key *rsa.PrivateKey) (*x509.Certificate, error) {
+func (p *Provider) Cert(s Signer, altnames []string, key *rsa.PrivateKey) ([]*x509.Certificate, error) {
csr, err := NewCSR(altnames, key)
if err != nil {
return nil, err
@@ -314,10 +314,24 @@ func (p *Provider) Cert(s Signer, altnames []string, key *rsa.PrivateKey) (*x509
return nil, err
}
- crt, _, err := p.parseCert(resp)
+ var crts []*x509.Certificate
+
+ crt, ns, err := p.parseCert(resp)
+ if err != nil {
+ return nil, err
+ }
+ crts = append(crts, crt)
+
+ resp, err = p.Get(ns.Link["up"])
+ if err != nil {
+ return nil, err
+ }
+
+ crt, _, err = p.parseCert(resp)
if err != nil {
return nil, err
}
+ crts = append(crts, crt)
- return crt, nil
+ return crts, nil
}