Created
January 5, 2020 06:14
-
-
Save troyfontaine/b8c165be951f12bced533d8bb4701007 to your computer and use it in GitHub Desktop.
Hackish Certbot HAProxy Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This is intended to work with https://github.com/greenhost/certbot-haproxy | |
DOMAIN="my.supercool.domain" # Replace this with your actual domain that certbot will be using | |
# Force renewal of certificate | |
certbot renew --force-renewal | |
# Sleep for authorization to complete | |
sleep 5m | |
# Create new unified cert | |
cd /etc/letsencrypt/live/$DOMAIN/ | |
cat fullchain.pem privkey.pem > $DOMAIN.pem | |
# Move certificate | |
mv $DOMAIN.pem /opt/certbot/haproxy_fullchains/ | |
# In your HAProxy configuration, you can use crt /opt/certbot/haproxy_fullchains | |
# note the lack of following slash! | |
# Restart HAProxy | |
systemctl restart haproxy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment