DEV Community

Discussion on: How to Enable SSL for Local Laravel Sail Development using Caddy and Docker

Collapse
 
mrdionjr profile image
Salomon Dion

Great post ! I've followed these steps but the certificate is not generated, only the authorities folder is populated. Can you please, look into it ? Also the start-container file produce and error when the if block is left empty, I've added an echo there.

Collapse
 
sonneybouy profile image
sonneybouy

So I spent the day with a colleague looking into this:

The reason there are no certificates generated and passed into your authorities folder is because the /caddy endpoint is not being successfully executed. This is essential for caddy to know which authorised domains to create certificates for.

If you tunnel into your caddy container, and curl for your application, you may observe that there is an error executing the file. Perhaps you have some authentication middleware preventing the /caddy endpoint from successfully executing.

We noticed that all Controller calls were being intercepted by middleware that demanded we logged in first.