#!/bin/sh # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You 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" # Encrypt all keys GENRSA="$OPENSSL genrsa -des3" # Uncomment for no key encryption # GENRSA="$OPENSSL genrsa" 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 <cabundle.crt <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 # Create PKCS12 localhost certificate $OPENSSL pkcs12 -export -passout $PASSPHRASE -passin $PASSPHRASE -in localhost.crt -inkey localhost.key -certfile ca.crt -out localhost.p12 $GENRSA -passout $PASSPHRASE -out user.key -rand .rnd 1024 cat >user.cfg <