13 lines
603 B
Bash
13 lines
603 B
Bash
#!/usr/bin/bash
|
|
export CN=$1
|
|
./create-key $CN
|
|
pushd certs
|
|
# The default algorithm is sha256 with Postfix ≥ 3.6 and the compatibility_level set to 3.6 or higher.
|
|
# With Postfix ≤ 3.5, the default algorithm is md5.
|
|
# https://www.postfix.org/postconf.5.html#relay_clientcerts
|
|
openssl x509 -in $CN.crt -noout -pubkey | openssl pkey -pubin -outform DER | openssl dgst -md5 -c | ( read D FP; echo $FP $CN ) >>relay_clientcerts
|
|
cp $CN.key ~/kopano-docker/etc-$CN/ssl/private
|
|
cp kopano-ca.crt ~/kopano-docker/etc-$CN/ssl/certs
|
|
cat kopano-ca.crt $CN.crt >~/kopano-docker/etc-$CN/ssl/$CN-full-chain.pem
|
|
popd
|