Skip to content

Instantly share code, notes, and snippets.

@btorch
Created November 26, 2013 22:15
Show Gist options
  • Save btorch/7667308 to your computer and use it in GitHub Desktop.
Save btorch/7667308 to your computer and use it in GitHub Desktop.
Create a self-signed (wildcard) SSL certificate
Create a self-signed (wildcard) SSL certificate
Posted on March 11, 2006, 11:35 pm, by justin, under HOWTOs, Linux.
The following commands are all you need to create a self-signed (wildcard, if you want) SSL certificate:
mkdir /usr/share/ssl/certs/hostname.domain.com
cd /usr/share/ssl/certs/hostname.domain.com
(umask 077 && touch host.key host.cert host.info host.pem)
openssl genrsa 2048 > host.key
openssl req -new -x509 -nodes -sha1 -days 3650 -key host.key > host.cert
...[enter *.domain.com for the Common Name]...
openssl x509 -noout -fingerprint -text < host.cert > host.info
cat host.cert host.key > host.pem
chmod 400 host.key host.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment