Skip to content

Instantly share code, notes, and snippets.

@nandotorres
Created December 12, 2016 17:49
Show Gist options
  • Save nandotorres/e94d6dadf50f457e1742ca9115755702 to your computer and use it in GitHub Desktop.
Save nandotorres/e94d6dadf50f457e1742ca9115755702 to your computer and use it in GitHub Desktop.
Generate key.pem and cert.pem to use with packer
#!/bin/bash
KEY_NAME=$1
PEM_NAME="${KEY_NAME}-key.pem"
CERTIFICATE_NAME="${KEY_NAME}-certificate.pem"
openssl genrsa 2048 > $PEM_NAME
openssl req -new -x509 -nodes -sha1 -days 365 -key $PEM_NAME -outform PEM > $CERTIFICATE_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment