sjelfull / Craft-CacheWarmer

Warm up your cache with a single request.
38 stars 4 forks source link

Setting for Cert Bundle Path, New Icon, .gitignore #4

Open hisnameisjimmy opened 6 years ago

hisnameisjimmy commented 6 years ago

I was running into errors when trying to run the cachewarmer plugin, the biggest one being SSL bundle issues with guzzle.

Specifically, this error: [curl] 60: SSL certificate problem: unable to get local issuer certificate [url]

I looked into it, and generally this is because guzzle can't find your certificate file: Guzzle Request Options

I found some solutions that recommended specifying the full path to the certificate bundle file. I went ahead and did that, and it worked. So I modified the plugin to be able to specify this path, as it might be a common problem with users where the bundle file location isn't clear to Guzzle. This path is optional, and is only executed if the setting exists.

I also wanted an icon for this, so I went ahead and created one and included it. Same for .gitignore, I immediately got a DS_Store file, so I wanted to kill that.

This resolves https://github.com/sjelfull/Craft-CacheWarmer/issues/3

sjelfull commented 6 years ago

Thanks! I actually have had a new version sitting around for ages (with a icon). I'll cut a new release soon that includes your changes and that icon.

hisnameisjimmy commented 6 years ago

I've since looked into this more, and this is actually more of an issue with the way GoDaddy issues their certs.

You have to concatenate the crt files they give you into a single bundle, then upload that to the server and reference it via the Nginx/Apache config. This only shows up in errors in certain places, and can be a bit obnoxious to debug.

For example, concatenate these files: sudo cat f84e19a2f44c6386.crt gd_bundle-g2-g1.crt >> coolexample.crt

More explanation: https://godaddy.com/help/nginx-on-centos-7-install-a-certificate-27192

Things that will force you to notice it:

I have not seen it fail in browser, on Chrome, Safari, or Firefox. I also have not seen it violate CORS.

Anyway, this is a long explanation, but I wanted to point it out so you don't needlessly implement this.