Setup Free SSL Letsencrypt with Acme.sh and Openlitespeed

noviyanto
2 min readApr 27, 2020
Photo by Philipp Katzenberger on Unsplash

In this tutorial I will cover how to setup free ssl in openlitespeed.

I will make very simple, but I hope you understand, because I’m not good on English writing.

Before we go!

In this tutorial we will use Automatic DNS API integration by acme.sh.

And here I’m using cloudflare for manage my domain.

Note: Dont use proxy by cloudflare, just leave DNS Only.

I assume you aleardy setup your domain using cloudflare with your server.

Install acme.sh on server

Install online, run this comamnd

curl https://get.acme.sh | sh

Or

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

Or install via git

git clone https://github.com/acmesh-official/acme.sh.git
cd ./acme.sh
./acme.sh — install

More: https://github.com/acmesh-official/acme.sh

After install acme.sh you can start issues certificates for your domain.

NOTE: This tutorial only work if your domain manage using cloudflare.

Add configuration for Cloudflare key and your cloudflare email. Run this command, CF key you can find on cloudflare dashboard.

export CF_Key="ABCD1234XXX123ABC"
export CF_Email="yourmail@mail.com"

This file will save on home/user/.acme.sh/account.conf

Issue Certifiacate

run this command and change example.com to your domain.

acme.sh --issue --dns dns_cf -d example.com -d www.example.com

If you want wildcard just run this command

acme.sh --issue --dns dns_cf -d 'example.tdc, *.example.tld'

We will just using youdomain.tld.key, fullchain.cer, ca.cer.

/home/USER/.acme.sh/YOURDOMAIN.TLD/YOURDOMAIN.TLD.key
/home/USER/.acme.sh/YOURDOMAIN.TLD/fullchain.cer
/home/USER/.acme.sh/YOURDOMAIN.TLD/ca.cer

Now you can setup certifcates using openlitespeed Admin panel.

Go your https://YOUR-IP:7080 and login

Go to Virtual Hosts -> select your VH -> Go to SSL and fill this field.

setup cerficaes on openlitespeed

Restart your openlitespeed/LSWS using

sudo systemctl restart lsws

Now check your ssl by visit your domain using https protocol. HTTPS://YOURDOMAIN.TLD/

If you have any error and anything to ask feel free to give comment to improve this post. Thank you.

--

--