Skip to content

Instantly share code, notes, and snippets.

@romanvanderkrogt
romanvanderkrogt / gist:1df30bc1857943d4aef6c9beeadd1244
Last active March 3, 2020 09:26 — forked from yuezhu/gist:47b15b4b8e944221861ccf7d7f5868f5
Generate self-signed certificate for HAProxy
# Generate a unique private key (KEY)
sudo openssl genrsa -out mydomain.key 2048
# Generating a Certificate Signing Request (CSR). Note "Common Name" should be server DNS
sudo openssl req -new -key mydomain.key -out mydomain.csr
# Creating a Self-Signed Certificate (CRT), see below for the contents of ssl.conf
sudo openssl x509 -req -days 365 -in mydomain.csr -signkey mydomain.key -out mydomain.crt -extensions req_ext -extfile ssl.conf
# Append KEY and CRT to mydomain.pem