3 # This is a wrapper script to create default certificates when the
4 # server first starts in debugging mode. Once the certificates have been
5 # created, this file should be deleted.
7 # Ideally, this program should be run as part of the installation of any
8 # binary package. The installation should also ensure that the permissions
9 # and owners are correct for the files generated by this script.
18 # If that worked, exit. Otherwise, run the commands manually.
26 # The following commands were created by running "make -n", and edited
27 # to remove the trailing backslash, and to add "exit 1" after the commands.
29 # Don't edit the following text. Instead, edit the Makefile, and
30 # re-generate these commands.
32 openssl dhparam -out dh 1024 || exit 1
33 if [ -e /dev/urandom ] ; then
34 dd if=/dev/urandom of=./random count=10 >/dev/null 2>&1;
38 openssl req -new -out server.csr -keyout server.key -config ./server.cnf || exit 1
39 openssl req -new -x509 -keyout ca.key -out ca.pem -days `grep default_days ca.cnf | sed 's/.*=//;s/^ *//'` -config ./ca.cnf || exit 1
40 openssl req -new -x509 -keyout ca.key -out ca.pem -days `grep default_days ca.cnf | sed 's/.*=//;s/^ *//'` -config ./ca.cnf || exit 1
43 openssl ca -batch -keyfile ca.key -cert ca.pem -in server.csr -key `grep output_password ca.cnf | sed 's/.*=//;s/^ *//'` -out server.crt -extensions xpserver_ext -extfile xpextensions -config ./server.cnf || exit 1
44 openssl pkcs12 -export -in server.crt -inkey server.key -out server.p12 -passin pass:`grep output_password server.cnf | sed 's/.*=//;s/^ *//'` -passout pass:`grep output_password server.cnf | sed 's/.*=//;s/^ *//'` || exit 1
45 openssl pkcs12 -in server.p12 -out server.pem -passin pass:`grep output_password server.cnf | sed 's/.*=//;s/^ *//'` -passout pass:`grep output_password server.cnf | sed 's/.*=//;s/^ *//'` || exit 1
46 openssl x509 -inform PEM -outform DER -in ca.pem -out ca.der || exit 1