summaryrefslogtreecommitdiff
path: root/net-ftp/pure-ftpd/files/pure-certd.script
blob: 77aa1bf9f702d39e43331bd2c86e1029c5ef6b12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# Copyright 1999-2022 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# Set default ssl directory
SSL_DIR="/etc/ssl/pure-ftpd"

# Check SNI and select certificate
case "${CERTD_SNI_NAME}" in
	domain1.tld)
		FILE_CERT="${SSL_DIR}/domain1.tld.crt"
		FILE_KEY="${SSL_DIR}/domain1.tld.key"
	;;

	domain2.tld)
		FILE_CERT="${SSL_DIR}/domain2.tld.crt"
		FILE_KEY="${SSL_DIR}/domain2.tld.key"
	;;
esac

# Print selected certificate for 'pure-certd'.
# You can modify 'action' for your needs.
# See man page of 'pure-certd' for more information.
echo "action:fallback"
echo "cert_file:${FILE_CERT}"
echo "key_file:${FILE_KEY}"
echo "end"