fix(ssl): harden TLS config and fix HTTP-to-HTTPS redirect (#7719)#7784
Conversation
FakerHideInBush
left a comment
There was a problem hiding this comment.
Two concerns before merging:
1. The new HTTP redirect block uses https://$host$request_uri — direct IP address access (http://50.28.86.131/...) will now redirect to https://50.28.86.131/... instead of https://rustchain.org/..., causing a TLS certificate error
The old config had an explicit rule:
if ($host = "50.28.86.131") {
return 301 https://rustchain.org$request_uri;
}This redirected direct IP access to the canonical domain. The new block:
server_name rustchain.org www.rustchain.org;
return 301 https://$host$request_uri;Since server_name does not include the IP, HTTP requests to 50.28.86.131 on port 80 will now fall through to nginx's default server (likely returning a 404 or the default welcome page) rather than being redirected. If you want to preserve the IP-to-domain redirect, either add the IP to server_name with a separate redirect to the canonical hostname, or add a default server block:
server {
listen 80 default_server;
server_name _;
return 301 https://rustchain.org$request_uri;
}2. The cipher list omits ChaCha20-Poly1305 variants, which are preferred for performance on devices without AES hardware acceleration
The hardened cipher list is:
ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384
Adding ChaCha20 variants is recommended by Mozilla's modern TLS config and improves performance for mobile clients and low-power hardware:
ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305
This is particularly relevant for a DePIN network where participants may be running mining nodes on vintage/low-power hardware.
06b6c60 to
1487f03
Compare
jaxint
left a comment
There was a problem hiding this comment.
Review Summary
This PR hardens TLS configuration and fixes HTTP-to-HTTPS redirect.
Changes:
- TLS config hardening
- HTTP-to-HTTPS redirect fix
Security Impact:
- Improves connection security
- Ensures proper protocol enforcement
✅ APPROVED
RTC RewardThis merged PR earned 5 RTC — sent to |
Closes #7719
RTC wallet: RTCfe13452d122263caf633ab1876bd9631133b68b
Changes
ECDHE-ECDSA-AES128-GCM-SHA256etc.) to prevent protocol downgradereturn 404with a clean301redirect to HTTPS for all hostsRoot cause
The
wrong version numberSSL error occurs when port 443 serves plain HTTP. The HTTP server block was usingreturn 404as a catch-all instead of redirecting to HTTPS, and the production block lacked explicit TLS protocol/cipher configuration.Testing