Skip to content

Instantly share code, notes, and snippets.

@sefacan
Created September 19, 2022 10:32
Show Gist options
  • Save sefacan/9044a4f2c72edd993ad551f2f7314e8a to your computer and use it in GitHub Desktop.
Save sefacan/9044a4f2c72edd993ad551f2f7314e8a to your computer and use it in GitHub Desktop.
#!/bin/sh
openssl genrsa -out key.pem 2048
openssl req -new -sha256 -key key.pem -out csr.csr
openssl req -x509 -sha256 -days 365 -key key.pem -in csr.csr -out certificate.pem
openssl req -in csr.csr -text -noout | grep -i "Signature.*SHA256" && echo "All is well" || echo "This certificate will stop working in 2017! You must update OpenSSL to generate a widely-compatible certificate"
mv key.pem ./ssl/cert.key
mv certificate.pem ./ssl/cert.pem
mv csr.csr ./ssl/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment