Create a SSL certificate containing 100 domains. :: From time to time, I need to create SSL certificates for hundreds, or even thousands of subdomains. This is because Let's Encrypt does not support "Wildcard SSL certificate" yet :)

Needless to say, I hit their limits pretty quickly ! :D ha ha
https://letsencrypt.org/docs/rate-limits/

So I looked around, and thankfully found a solution : SAN (Subject Alternative Name) certificate.

Basically you can create a single SSL certificate, which contains 100 domains in it. Cool :) another great feature from Let's Encrypt ! (y)

====
To make it easy for me (since I'm such a lazy sysadmin, LOL) I created a script to automate the creation of these SAN certificates :

http://pastebin.com/PBP7i8rN

Feel free to use it too. Hope you find it useful.

====
# !/bin/bash

# specify the location of Let's Encrypt tool
# and its parameters
certbot='/usr/bin/certbot --agree-tos --email my@email.com --apache --redirect --expand --renew-by-default -n '

# put the domain names in this file
vhost=( `cat "domain-list.txt" `)

# loop variables
ssl_exec="${certbot}"
n=1

#################### START ##########################

for t in "${vhost[@]}"
do

ssl_exec="${ssl_exec} -d $t "
let "n++"

# every 100th domain,
# create a SSL certificate for these 100 domains
# (SAN = Subject Alternative Name certificate)
if (( n == 100 )); then

$ssl_exec
# echo $ssl_exec

# reset the loop variables
ssl_exec="${certbot}"
n=1
fi

done

# create SSL certificate for the rest of the domains
$ssl_exec
# echo $ssl_exec

Photo
Shared publiclyView activity