Skip to content

cert_utils.sh – Incorrect alias #5212

@Alex-792337

Description

@Alex-792337

Bug/Feature:

Description: Describe bug or needed feature

Details:

Hiddify Version: 11.0.14b2
Python Version: 3.13.11 (main, Dec 17 2025, 21:08:16) [Clang 21.1.4 ]
OS: Linux-5.15.0-164-generic-x86_64-with-glibc2.35
User Agent: Unknown

Subject: Bug Fix in cert_utils.sh – Incorrect alias Usage Causing Certificate Renewal Failures

Dear Hiddify Manager Developer,

I hope this message finds you well.

I’d like to report a bug I encountered in the file /opt/hiddify-manager/acme.sh/cert_utils.sh that was causing certificate renewal to fail with the following errors:

./cert_utils.sh: line 56: alias: --issue: not found  
./cert_utils.sh: line 56: alias: -w: not found  
...  
./cert_utils.sh: line 62: acmecmd: command not found

Root Cause

The issue stems from an incorrect use of alias in a Bash script:

alias acmecmd=acme.sh --issue -w /opt/hiddify-manager/acme.sh/www/ ...

In Bash, alias does not support arguments and is not expanded reliably inside scripts, especially when defined mid-function. This causes the shell to interpret each token (--issue, -w, etc.) as separate invalid alias commands, leading to the errors above.

Additionally, the restricted_tlds array contained syntax errors due to commas instead of spaces:

"amazonaws.com","azurewebsites.net"  #

Solution Implemented

I replaced the faulty alias with a proper Bash function and fixed the TLD list:

# Fixed TLD list
restricted_tlds=("af" "by" ... "su" "sy" "zw" "amazonaws.com" "azurewebsites.net" "cloudapp.net")

# Replaced alias with function
acmecmd() {
    acme.sh --issue \
        -w /opt/hiddify-manager/acme.sh/www/ \
        --log /opt/hiddify-manager/log/system/acme.log \
        --pre-hook "systemctl restart hiddify-nginx" \
        "$@"
}

I also:

  • Added proper quoting for all variables,
  • Used absolute paths for log files,
  • Ensured error resilience with 2>/dev/null || true where appropriate.

After applying these changes and running sudo /opt/hiddify-manager/restart.sh, certificate renewal now works correctly without errors.

Suggested Action

Please consider integrating this fix into the main codebase to prevent similar issues for other users. The current implementation is fragile and fails silently on many systems due to Bash alias limitations.

Thank you for your excellent work on Hiddify Manager! Let me know if you’d like a pull request or further details.

Best regards,
Alex
System Administrator & Hiddify User

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions