File: ssl.rc

package info (click to toggle)
glusterfs 10.3-5
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 44,768 kB
  • sloc: ansic: 480,457; sh: 49,896; python: 12,979; makefile: 1,960; yacc: 487; lisp: 124; lex: 61; xml: 14
file content (20 lines) | stat: -rw-r--r-- 506 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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