SSL certificates are not renewed

I have several VPS servers, almost all of them hosted by Contabo, the problem is that lately the SSL certificates of the host are not updated and neither are those of the websites hosted on that server.

If I do a v-update-letsencrypt-ssl-host command not found** I get the following answer

If I do a v-add-letsencrypt-host I get CN = vps.tonwycloud4.com
error 10 at 0 depth lookup: certificate has expired

And I keep myself in a loop because I can’t access the panel and renew the SSL of the hosted domains either. Although I can usually renew them via SSH.

I stand corrected

After following the steps I have mentioned the SSL is working again and I can access the panel normally.

So I already have a procedure for when it happens again.

All this said:

It would be possible to use an instruction of the type

v-add-letsencrypt-domain user domain

With wildcards, type:

v-add-letsencrypt-domain * *. *

If you want to add a Let’s Encrypt certificate to all the web domains (and its alias) for all users, you can use this script:

#!/usr/bin/env bash
hcpbin="/usr/local/hestia/bin"
list_users="$hcpbin/v-list-users"
list_doms="$hcpbin/v-list-web-domains"
list_dom="$hcpbin/v-list-web-domain"
add_lets="$hcpbin/v-add-letsencrypt-domain"
for i in $("$list_users" plain | awk '{print $1}'); do
        for f in $("$list_doms" "$i" json | jq -r '.|to_entries[]|.key'); do
                echo ""$add_lets" "$i" "$f" "$("$list_dom" "$i" "$f" json | jq -r '.[].ALIAS')""
        done
done

To avoid problems, above script will only show the command that it will execute but won’t execute it, if you don’t care, use this:

#!/usr/bin/env bash
hcpbin="/usr/local/hestia/bin"
list_users="$hcpbin/v-list-users"
list_doms="$hcpbin/v-list-web-domains"
list_dom="$hcpbin/v-list-web-domain"
add_lets="$hcpbin/v-add-letsencrypt-domain"
for i in $("$list_users" plain | awk '{print $1}'); do
        for f in $("$list_doms" "$i" json | jq -r '.|to_entries[]|.key'); do
                "$add_lets" "$i" "$f" "$("$list_dom" "$i" "$f" json | jq -r '.[].ALIAS')"
        done
done
2 Likes

thanks again I will try it out

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.