Skip to content

Commit 86b06ef

Browse files
author
Kristan Kenney
committed
Merge branch 'fix/nginx-ssl-sni' into staging/fixes
2 parents e18ca0a + fae1c83 commit 86b06ef

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ All notable changes to this project will be documented in this file.
2121
- Fixed an issue where a `no backend template doesn't exist` could potentially would appear after upgrade with older templates (#1322).
2222
- Introduced caching templates for nginx + php-fpm configurations - thanks **@cmstew**!
2323
- Fixed an issue where DNS cluster updates could fail due to the format of a DKIM record in an available zone - thanks **@jrohde**!
24-
24+
- Improved the behavior of nginx SSL SNI detection to reject connections for domains which have no SSL certificate - thanks **@myrevery**!
2525

2626
## [1.3.0] - Major Release (Feature / Quality Update)
2727
### Features

install/deb/nginx/unassigned.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ server {
3737
server_name _;
3838
ssl_certificate /usr/local/hestia/ssl/certificate.crt;
3939
ssl_certificate_key /usr/local/hestia/ssl/certificate.key;
40+
ssl_reject_handshake on;
4041

4142
return 301 http://$host$request_uri;
4243

install/deb/templates/web/nginx/proxy_ip.tpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ server {
1313
}
1414

1515
server {
16-
listen %ip%:%proxy_ssl_port% ssl http2;
16+
listen %ip%:%proxy_ssl_port% ssl http2 default;
1717
server_name _;
1818
ssl_certificate /usr/local/hestia/ssl/certificate.crt;
1919
ssl_certificate_key /usr/local/hestia/ssl/certificate.key;
20+
ssl_reject_handshake on;
2021
2122
return 301 http://$host$request_uri;
2223

install/upgrade/versions/1.3.1.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,14 @@
55
#######################################################################################
66
####### Place additional commands below. #######
77
#######################################################################################
8+
9+
# Update nginx configuration to block connections for unsigned (no SSL certificate) domains
10+
for ipaddr in $(ls /usr/local/hestia/data/ips/ 2>/dev/null); do
11+
web_conf="/etc/$PROXY_SYSTEM/conf.d/$ipaddr.conf"
12+
13+
if [ "$PROXY_SYSTEM" = "nginx" ]; then
14+
echo "[ * ] Hardening nginx SSL SNI configuration..."
15+
cp -f $HESTIA_INSTALL_DIR/nginx/unassigned.inc $web_conf
16+
sed -i 's/directIP/'$ipaddr'/g' $web_conf
17+
fi
18+
done

0 commit comments

Comments
 (0)