Laravel Forge with Namecheap SSL
Published on by Eric L. Barnes
Laravel Forge makes setting up and activating an SSL super easy. In fact I was able to setup a new SSL certificate in less than 5 minutes. Here are the basic instructions for setting it up in an ideal world:
- Login to forge
- Visit the ssl tab for your domain
- Generate signing request
- Click “view CSR” and copy it
- Buy a new SSL cert
- Plug-in the key and activate
With my limited knowledge of setting up an SSL I missed an important step with the vendor and had to spend a lot of time tracking down the issue.
Namecheap SSL with Forge
Saturday night I decided to get an SSL cert for Laravel News. After the family went to bed I started researching various vendors and finally settled on Namecheap. I’ve heard good things about the company before and the pricing was hard to beat. They offer a very basic single domain cert named PositiveSSL, which is just $9 a year.
That seemed like a good deal for my needs. This site is just content and I’m not selling anything directly. So no need to go over board, right?
I purchased the cert, and seconds later received the email with all the “stuff” I needed. Included in the email was a huge warning:
We strongly recommend that you “click here” for instructions to ensure that your certificate is installed and your webserver is configured correctly.
Just as my luck would have it the “click here” actually went nowhere. Next I noticed at the bottom of the email it included a certificate for copy and pasting. I wrongly assumed I needed to plug this into Forge. When visiting the site in the browser I was getting SSL errors related to a broken SSL chain.
Instead you have to manually concatenate all the files they attached in the email. Running this is easy but it’s not outlined clearly in their documentation.
Generate a cert File
Here is how to get the proper SSL cert file.
Extract the zip included in the email and then cd
into the directory and run:
cat YOURDOMAIN_com.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > bundle.crt
Or you can open all these individually and copy and paste them into a new bundle.crt file.
Finally copy and paste the bundle.crt content into Laravel Forge and hit activate. Everything should then be all setup and running.
Eric is the creator of Laravel News and has been covering Laravel since 2012.