Created
August 23, 2021 18:06
-
-
Save AEntrepreneur/8d20d7d52aa7d21d3c4ab283dc1bf4c1 to your computer and use it in GitHub Desktop.
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
# Generate a folder for the files | |
sudo mkdir -p /etc/ssl/private | |
cd /etc/ssl/private | |
# Generate a unique private key (KEY) | |
sudo openssl genrsa -out myhaproxy.key 2048 | |
# Generating a Certificate Signing Request (CSR) | |
sudo openssl req -new -key myhaproxy.key -out myhaproxy.csr | |
# Creating a Self-Signed Certificate (CRT) | |
sudo openssl x509 -req -days 365 -in myhaproxy.csr -signkey myhaproxy.key -out myhaproxy.crt | |
# Append KEY and CRT to myhaproxy.pem | |
sudo bash -c 'cat myhaproxy.key myhaproxy.crt >> myhaproxy.pem' | |
# Specify PEM in haproxy config | |
sudo vim /etc/haproxy/haproxy.cfg | |
listen haproxy | |
bind 0.0.0.0:443 ssl crt /etc/ssl/private/myhaproxy.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment