Skip to content

Commit 87205d6

Browse files
authored
Fix TLSProtocol compatibility for old versions of ProFTPD (hestiacp#3790)
* Disable TLS 1.3 support for ProFTPD versions older than v1.3.7a due to incompatibility
1 parent 68bc0f0 commit 87205d6

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

install/hst-install-debian.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,6 +1543,11 @@ if [ "$proftpd" = 'yes' ]; then
15431543
cp -f $HESTIA_INSTALL_DIR/proftpd/proftpd.conf /etc/proftpd/
15441544
cp -f $HESTIA_INSTALL_DIR/proftpd/tls.conf /etc/proftpd/
15451545

1546+
# Disable TLS 1.3 support for ProFTPD versions older than v1.3.7a
1547+
if [ "$release" -eq 10 ]; then
1548+
sed -i 's/TLSProtocol TLSv1.2 TLSv1.3/TLSProtocol TLSv1.2/' /etc/proftpd/tls.conf
1549+
fi
1550+
15461551
update-rc.d proftpd defaults > /dev/null 2>&1
15471552
systemctl start proftpd >> $LOG
15481553
check_result $? "proftpd start failed"

install/hst-install-ubuntu.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,6 +1559,11 @@ if [ "$proftpd" = 'yes' ]; then
15591559
cp -f $HESTIA_INSTALL_DIR/proftpd/proftpd.conf /etc/proftpd/
15601560
cp -f $HESTIA_INSTALL_DIR/proftpd/tls.conf /etc/proftpd/
15611561

1562+
# Disable TLS 1.3 support for ProFTPD versions older than v1.3.7a
1563+
if [ "$release" = '20.04' ]; then
1564+
sed -i 's/TLSProtocol TLSv1.2 TLSv1.3/TLSProtocol TLSv1.2/' /etc/proftpd/tls.conf
1565+
fi
1566+
15621567
update-rc.d proftpd defaults > /dev/null 2>&1
15631568
systemctl start proftpd >> $LOG
15641569
check_result $? "proftpd start failed"

install/upgrade/versions/1.8.1.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Hestia Control Panel upgrade script for target version 1.8.0
3+
# Hestia Control Panel upgrade script for target version 1.8.1
44

55
#######################################################################################
66
####### Place additional commands below. #######

install/upgrade/versions/1.8.2.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
# Hestia Control Panel upgrade script for target version 1.8.2
4+
5+
#######################################################################################
6+
####### Place additional commands below. #######
7+
#######################################################################################
8+
####### upgrade_config_set_value only accepts true or false. #######
9+
####### #######
10+
####### Pass through information to the end user in case of a issue or problem #######
11+
####### #######
12+
####### Use add_upgrade_message "My message here" to include a message #######
13+
####### in the upgrade notification email. Example: #######
14+
####### #######
15+
####### add_upgrade_message "My message here" #######
16+
####### #######
17+
####### You can use \n within the string to create new lines. #######
18+
#######################################################################################
19+
20+
upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'false'
21+
upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'false'
22+
upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'false'
23+
upgrade_config_set_value 'UPGRADE_REBUILD_USERS' 'false'
24+
upgrade_config_set_value 'UPGRADE_UPDATE_FILEMANAGER_CONFIG' 'false'
25+
26+
# Disable TLS 1.3 support for ProFTPD versions older than v1.3.7a
27+
if [ "$FTP_SYSTEM" = "proftpd" ]; then
28+
os_release="$(lsb_release -s -i | tr "[:upper:]" "[:lower:]")-$(lsb_release -s -r)"
29+
30+
if [ "$os_release" = "debian-10" ] || [ "$os_release" = "ubuntu-20.04" ]; then
31+
if grep -qw "^TLSProtocol TLSv1.2 TLSv1.3$" test.conf 2> /dev/null; then
32+
sed -i 's/TLSProtocol TLSv1.2 TLSv1.3/TLSProtocol TLSv1.2/' /etc/proftpd/tls.conf
33+
else
34+
sed -i '/^TLSProtocol .\+$/d;/TLSServerCipherPreference on$/i TLSProtocol TLSv1.2' /etc/proftpd/tls.conf
35+
fi
36+
fi
37+
fi

0 commit comments

Comments
 (0)