Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS INWX Problem #4771

Closed
KevinGully opened this issue Aug 31, 2023 · 2 comments
Closed

DNS INWX Problem #4771

KevinGully opened this issue Aug 31, 2023 · 2 comments

Comments

@KevinGully
Copy link

Steps to reproduce

acme.sh --issue -d mydomain.com --dns dns_inwx
results in "invalid domain" "Error add txt for domain:_acme-challenge.mydomain.com"

What I found out:
The Problem appears in dns_inwx.sh

acme.sh/dnsapi/dns_inwx.sh

Lines 253 to 299 in 0da839c

_get_root() {
domain=$1
_debug "get root"
domain=$1
i=2
p=1
xml_content='<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>nameserver.list</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>pagelimit</name>
<value>
<int>9999</int>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>'
response="$(_post "$xml_content" "$INWX_Api" "" "POST")"
while true; do
h=$(printf "%s" "$domain" | cut -d . -f $i-100)
_debug h "$h"
if [ -z "$h" ]; then
#not valid
return 1
fi
if _contains "$response" "$h"; then
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
_domain="$h"
return 0
fi
p=$i
i=$(_math "$i" + 1)
done
return 1
}

The response in the Method get_root() at line 280 looks like this:
Error Code 2002 "Command use error"
But I don't know what's wrong.
3 Month ago everything was fine.
INWX API Doc

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>code</name>
            <value>
              <int>2002</int>
            </value>
          </member>
          <member>
            <name>msg</name>
            <value>
              <string>Command use error</string>
            </value>
          </member>
          <member>
            <name>svTRID</name>
            <value>
              <string>20230831-2893536221</string>
            </value>
          </member>
          <member>
            <name>runtime</name>
            <value>
              <double>0.001400</double>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>
@github-actions
Copy link

Please upgrade to the latest code and try again first. Maybe it's already fixed. acme.sh --upgrade If it's still not working, please provide the log with --debug 2, otherwise, nobody can help you.

@KevinGully
Copy link
Author

The Problem was found by @bekanne:

I found the problem in the dns_inwx.sh script. The cookie string cannot be saved because INWX changed a header key to lower case. This string is needed to stay authenticated for all further requests to the INWX API.

Solution:
In the dns_inwx.sh script the cookie string getting from a header value is being saved in a variable. The check for the header key should be case insensitive. This can be done by adding `-i`to the grep function:
https://github.com/acmesh-official/acme.sh/blob/0da839cce35f4ab014a6d62133fac03c8f4c6979/dnsapi/dns_inwx.sh#L197

So the line should be look like this:
`INWX_Cookie=$(printf "Cookie: %s" "$(grep "domrobot=" "$HTTP_HEADER" | grep -i "^Set-Cookie:" | _tail_n 1 | _egrep_o 'domrobot=[^;]*;' | tr -d ';')")`

@Kulturserver you can also use this as workaround by editing the .acme.sh/dnsapi/dns_inwx.sh file.

Originally posted by @bekanne in #4763 (comment)

And the INWX Dev also replied:

Hey there,

we just wanted to report this issue.

While header fields always were case-insensitive our infrastructure used "Set-Cookie" in its responses.
Last week we enabled HTTP/2 on our API. HTTP/2 does not allow uppercase characters in header fields anymore.

https://datatracker.ietf.org/doc/html/rfc9113#section-8.2.1

Best regards

Originally posted by @inwx-developer in #4763 (comment)

@KevinGully KevinGully closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant