mirror of
https://github.com/gluster/glusterfs.git
synced 2026-02-06 09:48:44 +01:00
Use 'openssl version -d' to detect path to OpenSSL trusted certificates and prefer it over the system-dependent hardcoded values and shell scripting quirks. Adjust related tests to use 'create_self_signed_certs()' function. Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com> Updates: #1000
21 lines
506 B
Bash
21 lines
506 B
Bash
#!/bin/bash
|
|
|
|
SSL_KEY=$SSL_CERT_PATH/glusterfs.key
|
|
SSL_CERT=$SSL_CERT_PATH/glusterfs.pem
|
|
SSL_CA=$SSL_CERT_PATH/glusterfs.ca
|
|
|
|
# Create self-signed certificates
|
|
function create_self_signed_certs (){
|
|
rm -f $SSL_KEY $SSL_CERT $SSL_CA
|
|
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_KEY $SSL_CERT $SSL_CA
|
|
}
|
|
|
|
push_trapfunc cleanup_certs
|