#!/bin/sh # Run a simple test over SSL CERT_DIR=`pwd`/test_cert_db CERT_PW_FILE=`pwd`/cert.password HOSTNAME=`hostname` COUNT=10000 trap stop_broker EXIT error() { echo $*; exit 1; } create_certs() { #create certificate and key databases with single, simple, self-signed certificate in it mkdir ${CERT_DIR} certutil -N -d ${CERT_DIR} -f ${CERT_PW_FILE} certutil -S -d ${CERT_DIR} -n ${HOSTNAME} -s "CN=${HOSTNAME}" -t "CT,," -x -f ${CERT_PW_FILE} -z /usr/bin/certutil } start_broker() { ../qpidd --daemon --transport ssl --port 0 --ssl-port 0 --no-data-dir --no-module-dir --auth no\ --load-module ../.libs/ssl.so --ssl-cert-db $CERT_DIR --ssl-cert-password-file $CERT_PW_FILE > qpidd.port PORT=`cat qpidd.port` } stop_broker() { ../qpidd -q --port $PORT } if [[ !(-e ${CERT_PW_FILE}) ]] ; then echo password > ${CERT_PW_FILE} fi if [[ !(-e ${CERT_DIR}) ]] ; then create_certs || error "Could not create test certificate" fi start_broker || error "Could not start broker" echo "Running SSL test on port $PORT" export QPID_LOAD_MODULE=../.libs/sslconnector.so export QPID_SSL_CERT_DB=${CERT_DIR} export QPID_SSL_CERT_PASSWORD_FILE=${CERT_PW_FILE} ./perftest --count ${COUNT} --port ${PORT} -P ssl -b $HOSTNAME --summary