r824 - crux-2.2/ports/core/openssl
Author: sip Date: 2006-02-24 17:32:23 +0100 (Fri, 24 Feb 2006) New Revision: 824 Added: crux-2.2/ports/core/openssl/mksslcert.sh Modified: crux-2.2/ports/core/openssl/.footprint crux-2.2/ports/core/openssl/.md5sum crux-2.2/ports/core/openssl/Pkgfile Log: openssl: added jue's mksslcert wrapper Modified: crux-2.2/ports/core/openssl/.footprint =================================================================== --- crux-2.2/ports/core/openssl/.footprint 2006-02-24 16:01:17 UTC (rev 823) +++ crux-2.2/ports/core/openssl/.footprint 2006-02-24 16:32:23 UTC (rev 824) @@ -13,6 +13,7 @@ drwxr-xr-x root/root usr/ drwxr-xr-x root/root usr/bin/ -rwxr-xr-x root/root usr/bin/c_rehash +-rwxr-xr-x root/root usr/bin/mksslcert -rwxr-xr-x root/root usr/bin/openssl drwxr-xr-x root/root usr/include/ drwxr-xr-x root/root usr/include/openssl/ Modified: crux-2.2/ports/core/openssl/.md5sum =================================================================== --- crux-2.2/ports/core/openssl/.md5sum 2006-02-24 16:01:17 UTC (rev 823) +++ crux-2.2/ports/core/openssl/.md5sum 2006-02-24 16:32:23 UTC (rev 824) @@ -1 +1,2 @@ +9d0df57845af8acd1027a7df5c18d017 mksslcert.sh 1d16c727c10185e4d694f87f5e424ee1 openssl-0.9.8a.tar.gz Modified: crux-2.2/ports/core/openssl/Pkgfile =================================================================== --- crux-2.2/ports/core/openssl/Pkgfile 2006-02-24 16:01:17 UTC (rev 823) +++ crux-2.2/ports/core/openssl/Pkgfile 2006-02-24 16:32:23 UTC (rev 824) @@ -5,7 +5,8 @@ name=openssl version=0.9.8a release=1 -source=(http://www.openssl.org/source/$name-$version.tar.gz) +source=(http://www.openssl.org/source/$name-$version.tar.gz \ + mksslcert.sh) build() { cd $name-$version @@ -14,4 +15,5 @@ make INSTALL_PREFIX=$PKG MANDIR=/usr/man MANSUFFIX=ssl install find $PKG -name "*fips*" -exec rm -f {} \; chmod -R +w $PKG + install -D -m 755 ../mksslcert.sh $PKG/usr/bin/mksslcert } Added: crux-2.2/ports/core/openssl/mksslcert.sh =================================================================== --- crux-2.2/ports/core/openssl/mksslcert.sh 2006-02-24 16:01:17 UTC (rev 823) +++ crux-2.2/ports/core/openssl/mksslcert.sh 2006-02-24 16:32:23 UTC (rev 824) @@ -0,0 +1,47 @@ +#!/bin/sh +# +# mksslcert +# +# creates self-signed openssl certificates based on +# the local hostname or the given one +# Fallback to localhost if not set. +# +# J�rgen Daubert, jue at jue dot li + + +print_help() { + echo "usage: ${0##*/} <key> <cert> [hostname]" + echo " key full path to openssl private key" + echo " cert full path to openssl certificate" + echo " hostname host name of certificate" +} + +main() { + if [ ! "$1" -o ! "$2" ]; then + print_help + exit 1 + fi + + KEY=$1 + CRT=$2 + FQDN=$(hostname -f) || FQDN=localhost + if [ ! -z "$3" ]; then + FQDN="$3" + fi + INFO=".\n.\n.\n.\n.\n$FQDN\nroot@$FQDN" + OPTS="req -new -nodes -x509 -days 365 -newkey rsa:1024" + + echo -e $INFO | openssl $OPTS -out $CRT -keyout $KEY 2> /dev/null + + if [ $? -ne 0 ]; then + echo "Error: creating of certificate failed" + exit 1 + else + echo "SSL certificate $CRT with key $KEY for host $FQDN created" + chmod 0600 $CRT $KEY + fi +} + +main "$@" + +# End of file Property changes on: crux-2.2/ports/core/openssl/mksslcert.sh ___________________________________________________________________ Name: svn:executable + *
participants (1)
-
crux@crux.nu