aboutsummaryrefslogtreecommitdiff
path: root/docker/pre/03_make_dhparam.sh
blob: d897b2789efa93177bbeb8d7c83e4448b43c70d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
set -e

source "${EJABBERD_HOME}/docker/lib/base_config.sh"
source "${EJABBERD_HOME}/docker/lib/config.sh"
source "${EJABBERD_HOME}/docker/lib/base_functions.sh"
source "${EJABBERD_HOME}/docker/lib/functions.sh"

make_dhparam() {
	local dhfile=$1
	local bits=$2

	log "Writing dh file to '${dhfile}'..."
	openssl dhparam -out ${dhfile} ${bits}
}

if is_true ${EJABBERD_DHPARAM} ; then
	file_exist ${SSLDHPARAM} \
		|| make_dhparam ${SSLDHPARAM} 4096
fi

exit 0