[packages/openssl102: 151/432] - script for creating selfsigned certs. Taken from debian (rewritten)

adwol adwol at pld-linux.org
Sat Sep 29 01:14:17 CEST 2018


commit 15ceaa80c64d8e61207307d34d3042b73dfe6ade
Author: Paweł Gołaszewski <blues at pld-linux.org>
Date:   Thu Jan 8 09:50:49 2004 +0000

    - script for creating selfsigned certs. Taken from debian (rewritten)
    
    Changed files:
        openssl-ssl-certificate.sh -> 1.1

 openssl-ssl-certificate.sh | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
---
diff --git a/openssl-ssl-certificate.sh b/openssl-ssl-certificate.sh
new file mode 100644
index 0000000..234c661
--- /dev/null
+++ b/openssl-ssl-certificate.sh
@@ -0,0 +1,33 @@
+#!/bin/sh -e
+
+CERT=/var/lib/openssl/certs/apache.pem
+export RANDFILE=/dev/random
+
+if [ "$1" != "--force" -a -f $CERT ]; then
+  echo "$CERT exists!  Use \"$0 --force.\""
+  exit 0
+fi
+
+if [ "$1" == "--force" ]; then
+  shift
+fi     
+
+echo
+echo creating selfsingned certificate
+echo "replace it with one signed by a certification authority (CA)"
+echo
+echo enter your ServerName at the Common Name prompt
+echo
+echo If you want your certificate to expire after x days call this programm 
+echo with "-days x" 
+
+# use special .cnf, because with normal one no valid selfsigned
+# certificate is created
+
+openssl req $@ -config /etc/openssl/openssl.cnf \
+  -new -x509 -nodes -out $CERT -keyout $CERT
+  
+chmod 600 $CERT
+
+ln -sf $CERT \
+  /var/lib/openssl/`/usr/bin/openssl x509 -noout -hash < $CERT`.0
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/openssl102.git/commitdiff/9fc1b1b87b259e8a327c99835865e91a391efc9e



More information about the pld-cvs-commit mailing list