Generate self-signed certificate for HAProxy
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 unique private key (KEY)|
|sudo openssl genrsa -out mydomain.key 2048|
|# Generating a Certificate Signing Request (CSR)|
|sudo openssl req -new -key mydomain.key -out mydomain.csr|
|# Creating a Self-Signed Certificate (CRT)|
|openssl x509 -req -days 365 -in mydomain.csr -signkey mydomain.key -out mydomain.crt|
|# Append KEY and CRT to mydomain.pem|
|sudo bash -c 'cat mydomain.key mydomain.crt >> /etc/ssl/private/mydomain.pem'|
|# Specify PEM in haproxy config|
|sudo vim /etc/haproxy/haproxy.cfg|
|bind 0.0.0.0:443 ssl crt /etc/ssl/private/mydomain.pem|
Feb 26, 2020
This helped me out. tutorials seem to give out too much information
Dec 1, 2020
Thanks it was helpfull.
Apr 9, 2021
thank I just use it to test. It fix my problem for create .pem wrong.
May 11, 2021
Maybe is it missing a sudo on line 8?
Aug 23, 2021
Thanks, I was looking for this...
Sep 13, 2021
Much needed information
Jan 31, 2022
thank you it was helpful.
PS: sudo is missing on line 8
Feb 14, 2023
You have saved my life! Thank you so much, brother.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Thanks I needed this