GoAdmio Command Line: zerossl with /go/zerossl

/go/zerossl gets a free 90-day SSL certificate from ZeroSSL and installs it for a hosted domain. It does the whole job in one command: You need a ZeroSSL account and its API key (available in the ZeroSSL dashboard). The domain must be in your Cloudflare account and known to GoAdmio (see dns), because validation is done with a DNS record. The folder /etc/ssl/<domain>, where GoAdmio keeps a domain's paid SSL files, must already exist (see openssl). Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Get and install a ZeroSSL certificate for a domain
/go/zerossl example.com <your-zerossl-api-key>

Options

Argument Required Notes
domain Yes The domain to secure. The folder /etc/ssl/<domain> must exist.
api-key Yes Your ZeroSSL API access key.

Examples

# Get and install a certificate
/go/zerossl example.com <your-zerossl-api-key>

# Back up the domain's SSL folder first
cp -a /etc/ssl/example.com /etc/ssl/example.com.backup

# Check the new certificate's expiry date
openssl x509 -enddate -noout -in /etc/ssl/example.com/cert.pem

Output

The command prints a few progress lines, then stops without a final success message.

Domain: example.com
ID: <certificate-id>
Validate certificate at ZeroSSL...

The command takes about a minute or more, because it waits 30 seconds after adding the DNS record and another 30 seconds after asking ZeroSSL to validate it.

Message Meaning
Directory /etc/ssl/<domain> That folder doesn’t exist. Exit status 1.
Missing Access Key No API key was given.
Invalid Access Key ZeroSSL rejected the API key.
Certificate Limit Reached Your ZeroSSL account has reached its certificate limit.
Duplicate Certificates Found ZeroSSL already has a certificate request for this domain.
Can not get SSL Domain ID ZeroSSL’s reply had no certificate ID, so the request failed for another reason.
Certificate Not Issued ZeroSSL hadn’t finished validating when the command tried to download.
Invalid API Function ZeroSSL didn’t recognize the download request.
The ZIP file is invalid or corrupted. The downloaded file isn’t a valid certificate package.

Every message above ends the command with exit status 1.

Log

Each run appends one line to /var/log/go/zerossl.log, including the API key:

[Nov 21 12:00:00]# zerossl example.com <your-zerossl-api-key>

See the full reference at /go/zerossl and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *