SSL Certificate update commande line

  • Hi everybody!

    I'm looking for the command line that may let me import ssl certificate without using the GUI:

    At the moment my Firewall generate my SSL certificate. I already have a working script running on OMV to import this certificate and put it everywhere i need it to be (dockers mainyl)

    I dont want to struggle changing the ssl cerificate used by OMV services (as omv web GUI, nginx) every 3 month :-)

    i see 2 options:

    1: theres an OMV command line to import certificates using whatever format, create the UUID as documantation want it, restart the web GUI

    2: I import the certificate as the existing UUID (overwriting the existanting SSL certificates)

    Thanks in advance for your help!

  • Here is a method to update an existing cert:

    Get the UUID for an existing cert with:
    sudo omv-confdbadm read "conf.system.certificate.ssl" | jq -r '.[] | "\(.uuid) \(.comment)"'

    Once you have that, the following script should update it in the database. You will just need to adjust the four variables at the top of the script.

    omv 5.5.5 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.5 plugins source code and issue tracker - github

    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • Thanks Ryecoaaron!

    Sorry but im getting an error:

    root@nas:~# sudo bash /root/
    /root/ ligne 3: /usr/share/openmediavault/scripts/helper-functions: Aucun fic hier ou dossier de ce type
    {"uuid":"xxxxxxxxxxxxxxxxxxxx","certificate":"-----BEGIN CERTIFICATE---------END CERTIFICATE-----","privatekey":"-----BEGIN RSA PRIVATE KEY--- ------END RSA PRIVATE KEY-----","comment":"let's encrypt ssl "}
    /root/ ligne 28: omv_exec_rpc : commande introuvable
    /root/ ligne 29: omv_exec_rpc : commande introuvable

    Am i doing something wrong?

    EDIT: Indeed working :Script encoding Format problem :-/

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!