From 5992cc0ecea65f921bed45d10c78e6a39b819d45 Mon Sep 17 00:00:00 2001 From: Kazuki Sawada Date: Fri, 2 Nov 2018 20:59:42 +0900 Subject: [PATCH] conoha: fix finding domain id (#697) --- providers/dns/conoha/conoha.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/providers/dns/conoha/conoha.go b/providers/dns/conoha/conoha.go index 969a9bd7..a872789f 100644 --- a/providers/dns/conoha/conoha.go +++ b/providers/dns/conoha/conoha.go @@ -89,7 +89,12 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) { func (d *DNSProvider) Present(domain, token, keyAuth string) error { fqdn, value, _ := acme.DNS01Record(domain, keyAuth) - id, err := d.client.GetDomainID(acme.ToFqdn(domain)) + authZone, err := acme.FindZoneByFqdn(fqdn, acme.RecursiveNameservers) + if err != nil { + return err + } + + id, err := d.client.GetDomainID(authZone) if err != nil { return fmt.Errorf("conoha: failed to get domain ID: %v", err) } @@ -113,7 +118,12 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { fqdn, value, _ := acme.DNS01Record(domain, keyAuth) - domID, err := d.client.GetDomainID(acme.ToFqdn(domain)) + authZone, err := acme.FindZoneByFqdn(fqdn, acme.RecursiveNameservers) + if err != nil { + return err + } + + domID, err := d.client.GetDomainID(authZone) if err != nil { return fmt.Errorf("conoha: failed to get domain ID: %v", err) }