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 ! 😀 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

Post imported by Google+Blog for WordPress.

13 thoughts on “Create a SSL certificate containing 100 domains

  1. Artikelnya sangat menarik dan bermanfaat. Sangat piawai dan mumpuni yang bikin artikel ini. Ditunggu Artikel – Artikel menarik berikutnya Bos……
    Terima kasih

    Jangan lupa mampir dan singgah ke AGEN POKER TERBESAR SE-ASIA dan TERPERCAYA :

    http://maindepok.com/ref.php?ref=SURISURI

    http://www.rajapoker99.com/ref.php?ref=RPP2016

    http://www.v88pkr.com/ref.php?ref=WOKEH12

    http://www.nanapoker.com/ref.php?ref=KATAKAMU

Leave a Reply

Your email address will not be published. Required fields are marked *