Browse Source

adding scripts to generate certificates

Option A: use Let's Encrypt to get a signed certificate
Option B: self-sign your certificate
master
Charles Reid 8 years ago
parent
commit
21685578b5
  1. 14
      generate_letsencrypt_cert.sh
  2. 18
      generate_ss_cert.sh

14
generate_letsencrypt_cert.sh

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
#!/bin/sh
#
# Generate you some certificates
# from Lets Encrypt
#
# https://charlesreid1.com/wiki/LetsEncrypt
export WEBROOT="/var/www/html"
export URL="reidmachine.party"
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get -y install certbot
certbot certonly --webroot -w ${WEBROOT} -d ${URL}

18
generate_ss_cert.sh

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
#!/bin/bash
#
# Generate a self-signed certificate
# You snake oil salesman you
#
# https://charlesreid1.com/wiki/RaspberryPi/SSH_Stunnel
# Use the openssl library to generate a 2048-bit private RSA key:
openssl genrsa -out key.pem 2048
# already generated a private key, so now we generate a certificate, and use our own key to sign it
openssl req -new -x509 -key key.pem -out cert.pem -days 365
# Now you have your private key in key.pem and your server's certificate in cert.pem.
# Put those both into the certificate file:
cat key.pem cert.pem >> stunnel.pem
Loading…
Cancel
Save