make_sni.sh revision c002c44ee5c7e7258f4ba5c162461c24a0c179c2
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend# Licensed to the Apache Software Foundation (ASF) under one or more
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend# contributor license agreements. See the NOTICE file distributed with
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend# this work for additional information regarding copyright ownership.
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend# The ASF licenses this file to You under the Apache License, Version 2.0
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend# (the "License"); you may not use this file except in compliance with
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend# the License. You may obtain a copy of the License at
909ce17e2bd0faef7b1c294f2307f009793fd493nd# Unless required by applicable law or agreed to in writing, software
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend# distributed under the License is distributed on an "AS IS" BASIS,
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0ce5630695a7aa568811a9dd0aceedd685f040dend# See the License for the specific language governing permissions and
42af92a661a06b3cebc88d585aad75064a309d51nd# limitations under the License.
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend# This script will populate a directory 'sni' with 3 sites, httpd.conf
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend# and certificates as to facilitate testing of TLS server name
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend# indication support (RFC 4366) or SNI.
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fendif [ $? != 0 ]; then
05ede5110427cb9dc071cc671d5aaba5d3b88c79nd echo "Syntax: $0 [-f] [-d outdir] [-D domain ] [two or more server names ]"
e8b603fa9ccf7b17b11b42df6d8916fd97c2331dnd echo " -f Force overwriting of outdir (default is $DIR)"
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend echo " -d dir Directory to create the SNI test server in (default is $DIR)"
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend echo " -D domain Domain name to use for this test (default is $DOMAIN)"
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend echo " [names] List of optional server names (default is $NAMES)"
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend echo "Example:"
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend echo " $0 -D SecureBlogsAreUs.com peter fred mary jane ardy"
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend shift; break;
6b0fe1f447ba35827cd5cf1d2a703bd8517f33ffmturkif [ $# = 1 ]; then
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend echo "Aborted - just specifing one servername makes no sense for SNI testing. Go wild !"
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend echo Aborted - your openssl is very old or misconfigured.
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend echo Aborted - version of openssl too old, 0.9 or up required.
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend echo Aborted - already an ${DIR} directory. Use the -f flag to overwrite.
# in the default openssl.conf file - so the certificate
serial=$$
-x509 \
cat << EOM