X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=apps%2FCA.sh;h=a0b20d85a97546a67bebbccdce40b3947c7e00fa;hb=036bbcc53ff0b7f0dd442bfea9451cbab4ef930d;hp=e63a2267eefebc593f6469782ffe6afb1b385839;hpb=16b1b03543fc6362f9e48f1bd9d4b153ea58c553;p=oweals%2Fopenssl.git diff --git a/apps/CA.sh b/apps/CA.sh index e63a2267ee..a0b20d85a9 100644 --- a/apps/CA.sh +++ b/apps/CA.sh @@ -30,12 +30,14 @@ # default openssl.cnf file has setup as per the following # demoCA ... where everything is stored +if [ -z "$OPENSSL" ]; then OPENSSL=openssl; fi + DAYS="-days 365" # 1 year CADAYS="-days 1095" # 3 years -REQ="openssl req $SSLEAY_CONFIG" -CA="openssl ca $SSLEAY_CONFIG" -VERIFY="openssl verify" -X509="openssl x509" +REQ="$OPENSSL req $SSLEAY_CONFIG" +CA="$OPENSSL ca $SSLEAY_CONFIG" +VERIFY="$OPENSSL verify" +X509="$OPENSSL x509" CATOP=./demoCA CAKEY=./cakey.pem @@ -51,15 +53,15 @@ case $i in ;; -newcert) # create a certificate - $REQ -new -x509 -keyout newreq.pem -out newreq.pem $DAYS + $REQ -new -x509 -keyout newkey.pem -out newcert.pem $DAYS RET=$? - echo "Certificate (and private key) is in newreq.pem" + echo "Certificate is in newcert.pem, private key is in newkey.pem" ;; -newreq) # create a certificate request - $REQ -new -keyout newreq.pem -out newreq.pem $DAYS + $REQ -new -keyout newkey.pem -out newreq.pem $DAYS RET=$? - echo "Request (and private key) is in newreq.pem" + echo "Request is in newreq.pem, private key is in newkey.pem" ;; -newca) # if explicitly asked for or it doesn't exist then setup the directory