Search code examples
lets-encryptbitnami

Getting Lego error passing email address using --email


To renew a LetsEncrypt certificate I was following this Bitnami doc and:

sudo /opt/bitnami/letsencrypt/lego --tls --email="somebody@example.com" --domains="example.com" --domains="www.example.com" --path="/opt/bitnami/letsencrypt" renew --days 90

kept returning the error:

You have to pass an account (email address) to the program using --email or -m

I tried retyping the hyphens and quotations in case they were being changed to en dashes and inverted commas in copy/paste, but no luck. Appreciate pointers to what I may be doing wrong or could do differently.


Solution

  • Bitnami Engineer here. It seems you have an old version of the lego binary in your instance, you have 2 options:

    • Use that previous version: In this case you will need to run this command instead
    sudo /opt/bitnami/letsencrypt/lego --email="somebody@example.com" --domains="example.com" --domains="www.example.com" --path="/opt/bitnami/letsencrypt" renew --days 90
    

    Note: I removed the --tls parameter

    • Update the lego binary
    cd /tmp
    curl -Ls https://api.github.com/repos/xenolf/lego/releases/latest | grep browser_download_url | grep linux_amd64 | cut -d '"' -f 4 | wget -i -
    tar xf lego_v2.6.0_linux_amd64.tar.gz
    sudo mkdir -p /opt/bitnami/letsencrypt
    sudo mv lego /opt/bitnami/letsencrypt/lego
    

    Note: 2.6.0 was the latest version of the lego binary when writing this message

    and then run your command again

    sudo /opt/bitnami/letsencrypt/lego --tls --email="somebody@example.com" --domains="example.com" --domains="www.example.com" --path="/opt/bitnami/letsencrypt" renew --days 90
    

    I hope this helps