#!/bin/sh # # Copyright 1999-2004 The Apache Software Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # # This is the configuration file to treate the CA certificate of the # _DEMONSTRATION ONLY_ 'Coyote' Certificate Authority. # This CA is used to sign the localhost.crt and user.crt # because self-signed server certificates are not accepted by all browsers. # NEVER USE THIS CA YOURSELF FOR REAL LIFE! INSTEAD EITHER USE A PUBLICALLY # KNOWN CA OR CREATE YOUR OWN CA! if [ -z "$OPENSSL" ]; then OPENSSL=openssl; fi PASSPHRASE="pass:secret" GENRSA="$OPENSSL genrsa -des3" REQ="$OPENSSL req -new" CA="$OPENSSL ca" X509="$OPENSSL x509" $OPENSSL rand -out .rnd 8192 $GENRSA -passout $PASSPHRASE -out ca.key -rand .rnd 1024 cat >ca.cfg <localhost.cfg <ca.serial cp /dev/null ca.index fi $CA -passin $PASSPHRASE -batch -config ca.cfg -extensions server_cert -policy server_policy -out x.crt -infiles localhost.csr $X509 -in x.crt -out localhost.crt rm -f x.crt $GENRSA -passout $PASSPHRASE -out user.key -rand .rnd 1024 cat >user.cfg <