faisareza

ssl-cert generate

Sep 3rd, 2016
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.51 KB | None | 0 0
  1. #
  2. # Create SSL certificates
  3. # for LKS Nasional
  4. #
  5.  
  6. DAYS=3650
  7. OUTFILE=$1-apache.pem
  8.  
  9. if [ -z "$1" ]; then
  10. echo "Usage: $0 [host.domain]"
  11. exit 10
  12. fi
  13.  
  14. echo "Generate SSL untuk host $1 ..."
  15.  
  16. (
  17. echo "My Country"
  18. echo "My Region"
  19. echo "My City"
  20. echo "My Company"
  21. echo "My Department"
  22. echo $1
  23. echo "webmaster@$1"
  24. echo
  25. echo
  26. ) |
  27. openssl req -new -nodes -keyout $1.key -out $1.req -days $DAYS
  28. openssl ca -policy policy_anything -notext -days $DAYS -out $1.crt -infiles $1.req
  29. chmod go= $1.crt $1.key $1.req
Advertisement
Add Comment
Please, Sign In to add comment