[CalendarServer-changes] [2048] CalendarServer/trunk/bin/make-ssl-key

source_changes at macosforge.org source_changes at macosforge.org
Thu Dec 6 14:51:29 PST 2007


Revision: 2048
          http://trac.macosforge.org/projects/calendarserver/changeset/2048
Author:   wsanchez at apple.com
Date:     2007-12-06 14:51:18 -0800 (Thu, 06 Dec 2007)

Log Message:
-----------
allow user not to create an authority by using NONE as the name

Modified Paths:
--------------
    CalendarServer/trunk/bin/make-ssl-key

Modified: CalendarServer/trunk/bin/make-ssl-key
===================================================================
--- CalendarServer/trunk/bin/make-ssl-key	2007-12-06 22:49:03 UTC (rev 2047)
+++ CalendarServer/trunk/bin/make-ssl-key	2007-12-06 22:51:18 UTC (rev 2048)
@@ -41,14 +41,16 @@
 # Do The Right Thing
 ##
 
-if [ ! -s "${authority}.key" ]; then
-  echo "Not a certificate authority key: ${authority}.key";
-  exit 1;
+if [ "${authority}" != "NONE" ]; then
+  if [ ! -s "${authority}.key" ]; then
+    echo "Not a certificate authority key: ${authority}.key";
+    exit 1;
+  fi;
+  if [ ! -s "${authority}.crt" ]; then
+      echo "Not a certificate authority certificate: ${authority}.crt";
+      exit 1;
+  fi;
 fi;
-if [ ! -s "${authority}.crt" ]; then
-  echo "Not a certificate authority certificate: ${authority}.crt";
-  exit 1;
-fi;
 
 newfile ()
 {
@@ -95,15 +97,17 @@
   echo "Certificate request for ${host} already exists.";
 fi;
 
-if [ ! -s "${host}.crt" ]; then
-  echo "Generating certificate...";
-  openssl x509 -req -in "${host}.csr" -out "${host}.crt" -sha1 -days 3650 \
-    -CA "${authority}.crt" -CAkey "${authority}.key" -CAcreateserial;
-  chmod 644 "${host}.crt";
-  echo "";
-else
-  echo "Certificate for ${host} already exists.";
+if [ "${authority}" != "NONE" ]; then
+  if [ ! -s "${host}.crt" ]; then
+    echo "Generating certificate...";
+    openssl x509 -req -in "${host}.csr" -out "${host}.crt" -sha1 -days 3650 \
+	-CA "${authority}.crt" -CAkey "${authority}.key" -CAcreateserial;
+    chmod 644 "${host}.crt";
+    echo "";
+  else
+    echo "Certificate for ${host} already exists.";
+  fi;
+
+  # Print the certificate
+  openssl x509 -in "${host}.crt" -text -noout;
 fi;
-
-# Print the certificate
-openssl x509 -in "${host}.crt" -text -noout;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20071206/bbbf54fd/attachment.html


More information about the calendarserver-changes mailing list