diff options
author | Gordon Sim <gsim@apache.org> | 2008-10-17 09:41:26 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2008-10-17 09:41:26 +0000 |
commit | 3e298ab616597ab3eb6f8859b72651a8b67505b0 (patch) | |
tree | 67ba47a1c8862700ce11b44dce9fbd3864fea8f1 /qpid/cpp/src/tests | |
parent | b67f0fcee107e921a160ab208256c500b8230261 (diff) | |
download | qpid-python-3e298ab616597ab3eb6f8859b72651a8b67505b0.tar.gz |
QPID-106: SSL support for c++ (broker and client), can be enabled/disabled explictly via --with-ssl/--without-ssl args to configure; by default will build the modules if dependencies are found. See SSL readme file for more details.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@705534 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests')
-rw-r--r-- | qpid/cpp/src/tests/Makefile.am | 3 | ||||
-rw-r--r-- | qpid/cpp/src/tests/ssl.mk | 4 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/ssl_test | 43 |
3 files changed, 50 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/Makefile.am b/qpid/cpp/src/tests/Makefile.am index 191b784180..1e82f88807 100644 --- a/qpid/cpp/src/tests/Makefile.am +++ b/qpid/cpp/src/tests/Makefile.am @@ -85,6 +85,9 @@ libshlibtest_la_LDFLAGS = -module -rpath $(abs_builddir) libshlibtest_la_SOURCES = shlibtest.cpp include cluster.mk +if SSL +include ssl.mk +endif # # Other test programs diff --git a/qpid/cpp/src/tests/ssl.mk b/qpid/cpp/src/tests/ssl.mk new file mode 100644 index 0000000000..8395aab35d --- /dev/null +++ b/qpid/cpp/src/tests/ssl.mk @@ -0,0 +1,4 @@ +TESTS+=ssl_test +EXTRA_DIST+=ssl_test +clean-local: + rm -rf test_cert_db cert.password
\ No newline at end of file diff --git a/qpid/cpp/src/tests/ssl_test b/qpid/cpp/src/tests/ssl_test new file mode 100755 index 0000000000..ed06f19fd3 --- /dev/null +++ b/qpid/cpp/src/tests/ssl_test @@ -0,0 +1,43 @@ +#!/bin/sh +# Run a simple test over SSL +MY_DIR=$(dirname $(which $0)) +CERT_DIR=${MY_DIR}/test_cert_db +CERT_PW_FILE=${MY_DIR}/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() { + ${MY_DIR}/../qpidd --daemon --transport ssl --port 0 --ssl-port 0 --no-data-dir --no-module-dir --auth no\ + --load-module ${MY_DIR}/../.libs/ssl.so --ssl-cert-db $CERT_DIR --ssl-cert-password-file $CERT_PW_FILE > qpidd.port + PORT=`cat qpidd.port` +} + +stop_broker() { + ${MY_DIR}/../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=${MY_DIR}/../.libs/sslconnector.so +export QPID_SSL_CERT_DB=${CERT_DIR} +export QPID_SSL_CERT_PASSWORD_FILE=${CERT_PW_FILE} +${MY_DIR}/perftest --count ${COUNT} --port ${PORT} -P ssl -b $HOSTNAME --summary + |