Skip to content

Instantly share code, notes, and snippets.

@BlackMaria
Created May 24, 2013 20:58
Show Gist options
  • Save BlackMaria/5646471 to your computer and use it in GitHub Desktop.
Save BlackMaria/5646471 to your computer and use it in GitHub Desktop.
This is what I eventually used to generate ssl keys for lumberjack. I had made several attempts that failed and with the help of tomar ( how pointed me to a page for apache certs... ) this is what I did and it worked.
#!/bin/sh
SERVER=logstash
################################################
if [ ! -f "${SERVER}.crt" -o ! -f "${SERVER}.key" ] ; then
rm -f ${SERVER}.{crt,key,csr}
openssl genrsa -des3 -out ${SERVER}.key 1024
openssl req -new -key ${SERVER}.key -out ${SERVER}.csr
cp ${SERVER}.key ${SERVER}.key.org
openssl rsa -in ${SERVER}.key.org -out ${SERVER}.key
openssl x509 -req -days 365 -in ${SERVER}.csr -signkey ${SERVER}.key -out ${SERVER}.crt
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment