summaryrefslogtreecommitdiffstats
path: root/tests/ssl.rc
diff options
context:
space:
mode:
authorRajesh Joseph <rjoseph@redhat.com>2016-08-02 15:33:34 +0000
committerKaushal M <kaushal@redhat.com>2016-08-28 23:19:33 -0700
commit62f4e41e9eafd2838d2a11989f08b0e7627284b4 (patch)
tree99780d4086823c5c4a51b2efcef8e0291f01c638 /tests/ssl.rc
parent70dabd796c04eb6e95fbf83e73219e671cc05dd3 (diff)
gfapi: SSL connection for mgmt connection is not working
Problem: libgfapi does not enable SSL on mgmt connection. Fix: Enable SSL when it is enabled on mgmt connection is enabled, i.e. presence of /var/lib/glusterd/secure-access file Change-Id: I1ce4935b04e6140aeab819e42076defd580b0727 BUG: 1362602 Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/15073 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'tests/ssl.rc')
-rw-r--r--tests/ssl.rc35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/ssl.rc b/tests/ssl.rc
new file mode 100644
index 00000000000..127f83f7577
--- /dev/null
+++ b/tests/ssl.rc
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+for d in /etc/ssl /etc/openssl /usr/local/etc/openssl ; do
+ if test -d $d ; then
+ SSL_BASE=$d
+ break
+ fi
+done
+
+if [ ! -d "$SSL_BASE" ]; then
+ echo "Skip test! SSL certificate path missing in the system" >&2
+ SKIP_TESTS
+ exit 0
+fi
+
+SSL_KEY=$SSL_BASE/glusterfs.key
+SSL_CERT=$SSL_BASE/glusterfs.pem
+SSL_CA=$SSL_BASE/glusterfs.ca
+
+
+# Create self-signed certificates
+function create_self_signed_certs (){
+ openssl genrsa -out $SSL_KEY 1024
+ openssl req -new -x509 -key $SSL_KEY -subj /CN=Anyone -out $SSL_CERT
+ ln $SSL_CERT $SSL_CA
+ return $?
+}
+
+function cleanup_certs () {
+ rm -f $SSL_BASE/glusterfs.*
+}
+
+push_trapfunc cleanup_certs
+
+cleanup_certs