File: ssl.rc

package info (click to toggle)
glusterfs 11.2-2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 28,244 kB
  • sloc: ansic: 471,238; sh: 45,610; python: 16,893; perl: 3,328; makefile: 2,014; yacc: 487; ruby: 171; lisp: 124; xml: 75; lex: 61
file content (20 lines) | stat: -rw-r--r-- 506 bytes parent folder | download | duplicates (4)
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