Skip to content

Instantly share code, notes, and snippets.

@gerald-kim
Created March 21, 2016 00:49
Show Gist options
  • Save gerald-kim/3d8fcc60c10b08b8ef02 to your computer and use it in GitHub Desktop.
Save gerald-kim/3d8fcc60c10b08b8ef02 to your computer and use it in GitHub Desktop.
*.dev ssl cert generation script
#! /usr/bin/env sh
FILE="test_require_sudo"
SUDO=`touch $FILE 2>/dev/null && rm $FILE || echo "sudo"`
if [ ! -e dev.key ]; then
$SUDO openssl genrsa -out dev.key 2048
fi
if [ ! -e dev.csr ]; then
$SUDO openssl req -new -key dev.key -out dev.csr \
-subj "/C=/ST=/L=/O=Dev Cert/OU=/CN=*.dev"
fi
if [ ! -e dev.crt ]; then
$SUDO openssl x509 -req -days 365 -in dev.csr -signkey dev.key -out dev.crt
fi
@gerald-kim
Copy link
Author

LICENSE(https://github.com/ysbaddaden/prax/blob/master/LICENSE)

Copyright (c) 2012 Julien Portalier

Sub command by Sam Stephenson, Nick Quaranto, 37signals.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment