]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/blobdiff - src/tlsproxy-add
tlsproxy-add,tlsproxy-setup: Check for invalid argument count.
[tlsproxy/tlsproxy.git] / src / tlsproxy-add
index b57697aa322ae07f7f2262a0cd5942b554b71713..f7a945a85e9a919ea81ddb41d7cd3f317cdbb21d 100755 (executable)
@@ -22,7 +22,7 @@
 
 set -e
 
-if test "$#" -eq 0; then
+if test "$#" -ne 1 && test "$#" -ne 2; then
     echo "Usage: $0 <hostname> [<server-certificate>]"
     echo
     echo "Add the server certificate <server-certificate> (as .pem file) for "
@@ -49,6 +49,7 @@ echo "cn = $1"                >> "$tempfile"
 echo tls_www_server           >> "$tempfile"
 echo encryption_key           >> "$tempfile"
 echo signing_key              >> "$tempfile"
+echo 'expiration_days = 3650' >> "$tempfile"
 certtool --generate-certificate \
          --load-privkey proxy-key.pem \
          --load-ca-certificate proxy-ca.pem \