Local HTTPS Testing¶
Use local HTTPS to validate real behavior for:
Request::isSecure()checks- HSTS header emission
- HTTPS redirect logic
- CSP behavior under secure context
Recommended setup (Sail host app)¶
- Generate local certificate:
./scripts/generate-local-https-cert.sh
-
Ensure Docker service exposes HTTPS port (example
8443). -
Start containers:
./vendor/bin/sail up -d --build
- Set app URL to HTTPS in host app
.env:
APP_URL=https://your-app.test:8443
- Clear config cache:
./vendor/bin/sail artisan optimize:clear
-
Open app on HTTPS URL:
-
https://your-app.test:8443 -
Open Sentinel dashboard:
-
https://your-app.test:8443/sentinel
Notes¶
- Browser may warn for self-signed cert; trust locally for testing.
- Keep
trustProxies('*')in Laravel middleware config when behind TLS proxy. - Keep production TLS at edge (Nginx/ALB/Cloudflare) plus app-level defense-in-depth.
Trust the local certificate¶
The generated files are:
docker/https/certs/<your-app>.crtdocker/https/certs/<your-app>.key
Use your actual certificate filenames if your generator script sets different names.
Ubuntu / Debian (NSS + system stores)¶
sudo cp docker/https/certs/<your-app>.crt /usr/local/share/ca-certificates/<your-app>.crt
sudo update-ca-certificates
Restart browser after trust update.
macOS¶
- Open
Keychain Access. - Import
docker/https/certs/<your-app>.crtintoSystemkeychain. - Open certificate, set
TrusttoAlways Trust. - Restart browser.
Windows¶
- Run
certmgr.msc. - Import
docker/https/certs/<your-app>.crtintoTrusted Root Certification Authorities. - Restart browser.
Quick verification¶
curl -k -I https://your-app.test:8443
curl -k -I https://your-app.test:8443/sentinel
If Sentinel headers are enabled, responses should include configured security headers.