Skip to content

Trust the DDEV mkcert CA so tests can browse the project over HTTPS - #95

Open
vever001 wants to merge 2 commits into
ddev:mainfrom
vever001:trust-ddev-mkcert-ca
Open

Trust the DDEV mkcert CA so tests can browse the project over HTTPS#95
vever001 wants to merge 2 commits into
ddev:mainfrom
vever001:trust-ddev-mkcert-ca

Conversation

@vever001

Copy link
Copy Markdown

The Issue

The test runners default to http://web, so the browser never needs to trust a certificate. Projects that have to browse the real project URL, for example a multisite where the hostname selects the site, land on a certificate warning page instead of the site.

How This PR Solves The Issue

Mount ddev-global-cache, where DDEV keeps mkcert/rootCA.pem, and import it into the browser's NSS database on start. Projects staying on http://web are unaffected, they just get one more trusted CA in the test browser.

Manual Testing Instructions

ddev add-on get https://github.com/ddev/ddev-selenium-standalone-chrome/tarball/refs/pull/REPLACE_ME_WITH_THIS_PR_NUMBER/head
ddev restart

Check that the CA was imported:

ddev exec -s selenium-chrome certutil -d sql:/home/seluser/.pki/nssdb -L

ddev-mkcert should be listed next to the image's own SeleniumHQ_tls.crt.

To see the actual effect, point a browser test at the project URL rather than http://web: before this change it lands on the Privacy error page instead of the site.

Automated Testing Overview

Added an assertion to health_checks() in tests/test.bats that lists the browser's NSS database and expects ddev-mkcert. The existing tests all browse http://web, so none of them would notice this breaking.

Release/Deployment Notes

No breaking changes. The hook is a no-op when mkcert/rootCA.pem is absent, for example in CI or when DDEV is configured without TLS.

vever001 added 2 commits July 31, 2026 21:09
The test runners default to http://web, so the browser never needs to trust
a certificate. Projects that have to browse the real project URL, for example
a multisite where the hostname selects the site, land on a certificate warning
page instead of the site.

Mount ddev-global-cache, where DDEV keeps mkcert/rootCA.pem, and import it into
the browser's NSS database on start. Projects staying on http://web are
unaffected, they just get one more trusted CA in the test browser.

Fixes ddev#94
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trust the DDEV mkcert CA, so tests can browse the project over HTTPS

1 participant