Contao 4.13 removed the web Install Tool: where should HTTPS enforcement and custom CA trust now live?
0 reputation · 16 Sept 2023, 21:07 UTC
0 reputation · 16 Sept 2023, 21:07 UTC
We are planning a migration to Contao 4.13 LTS, where the legacy web Install Tool at /contao/install.php has been removed in favor of the Contao Manager and the contao:install-web console command. Previously, the Install Tool UI was where forced HTTPS could be toggled during setup.
The site will run behind a reverse proxy that terminates TLS with a certificate issued by an internal CA. Contao still ships an HTTPS middleware that reads $_SERVER['HTTPS'] and redirects when CONTAO_FORCE_HTTPS is enabled, but as far as I can tell it performs no certificate-chain validation itself and assumes TLS was already terminated upstream. Outbound requests, such as extension repository checks, appear to rely on the system CA bundle or Guzzle configuration rather than anything Contao-specific.
With the Install Tool gone, what is the documented, upgrade-safe place to enforce HTTPS in 4.13: the CONTAO_FORCE_HTTPS environment variable, web server redirect rules, or both?
For outbound HTTPS calls that must trust our internal CA, should the certificate be added to the system CA bundle, or is there a supported way to pass a custom CA to Contao's HTTP client configuration?
In a containerized deployment, is there any risk that the environment variable is silently ignored, and how can that be verified without the old Install Tool UI?
With the web Install Tool removed, HTTPS enforcement is now a two-layer concern:
CONTAO_FORCE_HTTPS environment variable still works, but it relies on $_SERVER['HTTPS'] being correctly set by your proxy. If the proxy doesn't pass this header, Contao cannot enforce HTTPS.Contao uses Guzzle for HTTP requests (e.g., extension checks). To trust your internal CA:
/etc/ssl/certs/ca-certificates.crt on Debian/Ubuntu, then run update-ca-certificates). This affects all system processes, including PHP.curl.cafile directive in php.ini to point to your internal CA file.In containerized setups, ensure CONTAO_FORCE_HTTPS is passed to the PHP-FPM process. Verify it's visible:
# Run inside the PHP container
php -r "echo getenv('CONTAO_FORCE_HTTPS') ?: 'NOT SET';"
# Or check via Contao's debug mode
php bin/console debug:container --env-vars | grep CONTAO
curl -I http://your-domain.com 2>/dev/null | grep -i location
HTTP_X_FORWARDED_PROTO to https when terminating TLS.HTTPS=on or sets HTTP_X_FORWARDED_PROTO=https.One missing diagnostic detail that would refine this answer: Are you using a specific reverse proxy (e.g., Traefik, Caddy, Envoy) that handles TLS termination? If so, what headers does it pass to the PHP-FPM backend?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.