These Instructions are for an ubuntu installation with nginx as the server. This method enables a user to get (free) certificates from an opensource provider and requires the website name to be publicly accessible. These instructions may not be applicable in other environments. Follow all applicable certificate policies when installing.

Instructions for creating and renewing a certificate are here.

Before obtaining the certificates ensure that there are two DNS A record for the website name (i.e. demonodepublicdns). 

Getting the Certificates (letsencrypt example):

root@ubuntu:~# sudo apt-get update
root@ubuntu:~# sudo apt-get -y install nginx
root@ubuntu:~# wget https://dl.eff.org/certbot-auto
root@ubuntu:~# chmod a+x certbot-auto
root@ubuntu:~# ./certbot-auto
root@ubuntu:~# ./certbot-auto certonly --webroot -w /usr/share/nginx/html -d demonodepublicdns

                                                             ┌────────────────────────────┐
                                                             │ Enter email address (used  │  
                                                             │ for urgent notices and     │  
                                                             │ lost key recovery)         │  
                                                             │ ┌────────────────────────┐ │  
                                                             │ │xxxx@xxxx.xx            │ │  
                                                             │ └────────────────────────┘ │  
                                                             ├────────────────────────────┤  
                                                             │   <  OK  >  <Cancel>       │  
                                                             └────────────────────────────┘                                                                           
                                         ┌───────────────────────────────────────────────────────────────────┐
                                         │ Please read the Terms of Service at                               │  
                                         │ https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf. │  
                                         │ You must agree in order to register with the ACME server at       │  
                                         │ https://acme-v01.api.letsencrypt.org/directory                    │  
                                         ├───────────────────────────────────────────────────────────────────┤  
                                         │                   <Agree >          <Cancel>                      │  
                                         └───────────────────────────────────────────────────────────────────┘  

                                                                                                               

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at
   /etc/letsencrypt/live/demonodepublicdns/fullchain.pem. Your cert
   will expire on 2016-09-29. To obtain a new or tweaked version of
   this certificate in the future, simply run letsencrypt-auto again.
   To non-interactively renew *all* of your certificates, run
   "letsencrypt-auto renew"
 - If you like Certbot, please consider supporting our work by:
   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le
root@ubuntu:/opt/letsencrypt# ls /etc/letsencrypt/live/demonodepublicdns/
cert.pem  chain.pem  fullchain.pem  privkey.pem

         

Renewing the Certificates:

Renewing the Certificates on a DATIM Global

Renewing the Certificates on a DATIM node

Automatic Certificate Renewal:

Automatic certificate renewal can be installed on a DATIM box to ensure that the certificate on this machine is automatically renewed. The process consists of Two Parts:

  1. Install the package `datim-auto-cert-updater`
    1. Ensure the PPA is installed
    2. Configure the installation
  2. Test the installation
    1. Immediately check that all functionality works
    2. Return in a few days and check that the cronjob is called successfully

The instructions to do these steps are outlined at the following link: https://github.com/OHIEDATIM/datim-auto-cert-updater/blob/master/docs/testing/readme.md

Certificate creation on CentOS:

BAO has created custom scripts to aid in the creation of certificates on CentOS and Amazon Linux hosts. That script is called certbot-new and is available on hosts with the BAO yum repository installed. In order to create a new certificate, use the following steps:

Certificate Renewal:

If the server was installed by BAO, or using BAO's tools, the cron job will automatically be installed in /etc/cron.daily/certbot-renew.

Essentially, the certbot-renew script runs the following:

certbot \
  renew \
  --quiet \
  --non-interactive \
  --agree-tos \
  --preferred-challenges 'http-01' \
  --pre-hook '/bin/mkdir -pv /var/lib/letsencrypt/html/' \
  --renew-hook "$RENEW_HOOK"