a black and white photo of a njoguamos in a suit and with a serious look on his face

Fix Secure Connection Failed when Using Laravel Herd or Valet with Firefox

Created 27 Aug 2023 | Updated 30 Aug 2023

LaravelLaravel Herd

So you have installed Laravel Herd and secured your sites. You are now ready to start developing your applications. You fire the Firefox browser. Boom! You get an error `Secure Connection Failed, Error code: SEC_ERROR_BAD_SIGNATURE.

a screen shot of the security connection failed section of a webpage, with the text secure connection failed highlighted

About Laravel Heard : If you have not heard about Laravel Heard, I recommend you check out Announcing Laravel Herd by Marcel Pociot.

Even though Laravel Heard has added the certificate as "trusted" in the macOS keychain, Firefox maintains its own root certificate Store and does not see the "trusted" certificates.

Fixing the SEC ERROR BAD SIGNATURE error

Press CMD + , to open Firefox settings. Use the search box to look for certificates. Select View Certificates.

a screenshot of a web page with the search box highlighted in the bottom right corner of the screen

When certificate manager dialog opens, select Authorities tab then click import...

a screenshot a screenshot of firefor 116 certificate manager settings

Locate Laravel Heard self signing authority located /Users/<username>/Library/Application Support/Herd/config/valet/CA/LaravelValetCASelfSigned.pem where <username> represent your user folder. Select the file and clock open.

Tip : You can press CMD + Shift + G to go to the folder

a screenshot of a computer screen with an open dialog for selcting a file

Laravel valet : In case you are using Laravel Valet the path for the certificate is /Users/<username>/.config/valet/CA/_LaravelValetCASelfSigned_.pem

In the new dialog, select Trust this CA to Identify website. Now all *.test website should be secured by defaults.

a screenshot of a computer screen with a text description

Dismiss all the open dialogs by clicking OK.

Conclusion

If you follow the instructions, the error should disappear for all *.test domains. It is important to note the location of the LaravelValetCASelfSigned.pem as you may require in Android and iOS development (if it applies to you).

Reach out

Let’s talk about working together.

Available for new opportunities