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 OVH API didn't works #5269

Open
EasyCyril opened this issue Aug 27, 2024 · 1 comment
Open

DNS OVH API didn't works #5269

EasyCyril opened this issue Aug 27, 2024 · 1 comment

Comments

@EasyCyril
Copy link

Steps to reproduce

Follow these steps https://github.com/acmesh-official/acme.sh/wiki/How-to-use-OVH-domain-api is not working using an ovh application credential.

All API calls falls in : dns_ovh.sh:_ovh_rest:325 response='{"class":"Client::BadRequest","message":"Invalid signature"}'

Fix

This fail is caused by an improper usage of curl that not force the method GET on _get function.

Here the fix of dns_api.sh :

diff --git a/dnsapi/dns_ovh.sh b/dnsapi/dns_ovh.sh
index 7f62c05e..a0fe2f59 100755
--- a/dnsapi/dns_ovh.sh
+++ b/dnsapi/dns_ovh.sh
@@ -307,18 +307,16 @@ _ovh_rest() {
   _ovh_hex="$(printf "%s" "$_ovh_p" | _digest sha1 hex)"
   _debug2 _ovh_hex "$_ovh_hex"
 
-  export _H1="X-Ovh-Application: $OVH_AK"
-  export _H2="X-Ovh-Signature: \$1\$$_ovh_hex"
+  
+  export _H1="X-Ovh-Application:$OVH_AK"
+  export _H2="X-Ovh-Signature:\$1\$$_ovh_hex"
   _debug2 _H2 "$_H2"
-  export _H3="X-Ovh-Timestamp: $_ovh_t"
-  export _H4="X-Ovh-Consumer: $OVH_CK"
-  export _H5="Content-Type: application/json;charset=utf-8"
-  if [ "$data" ] || [ "$m" = "POST" ] || [ "$m" = "PUT" ] || [ "$m" = "DELETE" ]; then
-    _debug data "$data"
-    response="$(_post "$data" "$_ovh_url" "" "$m")"
-  else
-    response="$(_get "$_ovh_url")"
-  fi
+  export _H3="X-Ovh-Timestamp:$_ovh_t"
+  export _H4="X-Ovh-Consumer:$OVH_CK"
+  
+  _debug data "$data"
+  response="$(_post "$data" "$_ovh_url" "" "$m" "application/json;charset=utf-8")"
+  
 
   if [ "$?" != "0" ] || _contains "$response" "INVALID_CREDENTIAL"; then
     _err "error $response"
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.

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