LetsEncrypt setup

I had some free time, and an upcoming expiring cert on my GMS server so I decided to give LE a shot on GMS.
I thought I would share how I set it up, in case anyone was curious. Seems to be working OK with Android and IOS. I have no Windows phone to test it on, but I wouldn't expect any issues.

I am running on SLES11 SP4, and using acme.sh for my LE client.

here is the basic setup:

install acme.sh using wget
acme.sh github


#wget -O - https://get.acme.sh|sh


issue certs using acme.sh, adding autodiscover as a SAN
with mobile.domain.com being your GMS server fqdn


#acme.sh --issue -d mobile.domain.com --standalone -d autodiscover.domain.com


If you receive an error(I did) about missing netcat(nc), even though netcat is installed, install netcat-openbsd through YAST and try again.

This will create a cron entry that will run every night, but only generate new certs every 60 days.
certs will be downloaded to ~/.acme.sh/mobile.domain.com/

to create the cert that GMS can use:

#cat ~/.acme.sh/mobile.domain.com/mobile.domain.com.key ~/.acme.sh/mobile.domain.com/fullchain.cer > ~/.acme.sh/mobile.domain.com/server.pem;


I added this bit to see if the file has changed from last time, and if it has, copy to where GMS can see it and restart GMS.

ck1=`md5sum ~/.acme.sh/mobile.domain.com/server.pem|awk -F" " '{print $1}'`;
ck2=`md5sum /var/lib/datasync/device/mobility.pem|awk -F" " '{print $1}'`;

if [ $ck1 != $ck2 ]
then
/bin/cp -f ~/.acme.sh/mobile.domain.com/server.pem /var/lib/datasync/webadmin/server.pem;
/bin/cp -f /var/lib/datasync/webadmin/server.pem /var/lib/datasync/device/mobility.pem;
/usr/sbin/rcgms restart;
fi;
Parents
  • wow, that was EASY!  Thanks!

    I've been renewing and installing my GMS cert by hand every 90 days for years, thinking "one of these days I'll figure out how to automate it", but I kept thinking it was going to be a major ordeal that I just didn't have time for.

    Notes for anyone doing it now:

    1)you need socat tools:

    #zypper in socat

    2)you do need port 80 access from the internet to the gms server.  I didn't have it, since nothing used port 80 before.  don't worry about exposing anything though, nothing is listening on port 80 - it's only live for a second or two every 60 days when the domain is validated

    3)create a script to do the additional steps needed for gms:

    /root/sslinstall.sh: 

     

     

    cat ~/.acme.sh/mobile.domain.com/mobile.domain.com.key ~/.acme.sh/mobile.domain.com/fullchain.cer > ~/.acme.sh/mobile.domain.com/server.pem; ck1=`md5sum ~/.acme.sh/mobile.domain.com/server.pem|awk -F" " '{print $1}'`; ck2=`md5sum /var/lib/datasync/device/mobility.pem|awk -F" " '{print $1}'`; if [ $ck1 != $ck2 ] then /bin/cp -f ~/.acme.sh/mobile.domain.com/server.pem /var/lib/datasync/webadmin/server.pem; /bin/cp -f /var/lib/datasync/webadmin/server.pem /var/lib/datasync/device/mobility.pem; /usr/sbin/rcgms restart; fi;

     

     

    then add a cron entry (/var/spool/cron/tabs/root):

    20 0 * * *  "/root/sslinstall.sh"

    (that just runs 5 minutes after the acme.sh script that was installed automatically; it does nothing unless the certificate has changed)

     

  • After my success with acme.sh on my GMS server running SLES12SP3, I started trying to install it on another server running SLES11SP4/OES2015SP1.  Couldn't even get the acme.sh script due to SSL errors.  Spent awhile tearing my hair out until I figured out I needed a wget that can use TLSv1.2/SSLv3:

    Long version: https://www.suse.com/documentation/suse-best-practices/singlehtml/securitymodule/securitymodule.html

    Short version (this assumes you otherwise are patched up to date):

    find out which repo is the security repo: #zypper repos | grep Security

    enable the repo: #zypper modifyrepo -e 8 <--- whichever repo number you got from the first command

    install the alternate wget: #zypper in wget-openssl1

    activate it: #update-alternatives --set wget /usr/bin/wget.openssl1

    now proceed with the acme.sh install: #wget -O - https://get.acme.sh|sh

     

Reply
  • After my success with acme.sh on my GMS server running SLES12SP3, I started trying to install it on another server running SLES11SP4/OES2015SP1.  Couldn't even get the acme.sh script due to SSL errors.  Spent awhile tearing my hair out until I figured out I needed a wget that can use TLSv1.2/SSLv3:

    Long version: https://www.suse.com/documentation/suse-best-practices/singlehtml/securitymodule/securitymodule.html

    Short version (this assumes you otherwise are patched up to date):

    find out which repo is the security repo: #zypper repos | grep Security

    enable the repo: #zypper modifyrepo -e 8 <--- whichever repo number you got from the first command

    install the alternate wget: #zypper in wget-openssl1

    activate it: #update-alternatives --set wget /usr/bin/wget.openssl1

    now proceed with the acme.sh install: #wget -O - https://get.acme.sh|sh

     

Children