1
0
mirror of https://github.com/gluster/glusterfs.git synced 2026-02-06 00:49:30 +01:00
Files
glusterfs/tests/ssl.rc
Mohammed Rafi KC f221ba83e1 ssl/test: Change the rsa key length to 2048
On a rhel-8 machine, we need to have a key length
greater than or eaual to 2048. So changing the values
to 2048 to pass the test.

Credits: Mohit Agrawal <moagrawal@redhat.com>

Change-Id: I0f21db4d737203d0b2e44e7e61f50ae1279795ad
Updates: bz#1756900
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
2019-10-29 14:57:02 +00:00

36 lines
757 B
Bash

#!/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 2048
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