I was trying to do some work with a web site and certificates and found this site. Now, if you’re like me, I don’t do this sort of thing often enough to remember all the commands, so this website is a true blessing. Another thing I picked up from another web site a while back (sorry, don’t remember the site) is a script to create a certificate request. Which is really quite handy if you don’t do it all the time. So for the benefit of all, here’s the script, I would gladly give credit where credit is due if I could remember the site. Oh, and by the way, this is for a linux based system…
#!/bin/sh SERVER=my.server.com PRIVATE_KEY=$SERVER.key CERTIFICATE_FILE=$SERVER.crt SIGNING_REQUEST=$SERVER.csr VALID_DAYS=712 echo Delete old private key rm $PRIVATE_KEY echo Create new private/public-keys without passphrase for server openssl genrsa -out $PRIVATE_KEY 1024 echo Create file for signing request rm $SIGNING_REQUEST openssl req -new -days $VALID_DAYS -key $PRIVATE_KEY -out $SIGNING_REQUEST echo Filename for signing request is: $SIGNING_REQUEST echo Filename for private key is: $PRIVATE_KEY echo Filename for certificate file is: $CERTIFICATE_FILE echo Submit this signing request to echo https://where.ever.com/ssl_cert/request/ echo ... cat $SIGNING_REQUEST
I hope someone can find this as useful as I did.