honeybadger-io / honeybadger-laravel

PHP/Laravel library for reporting errors to Honeybadger.io :elephant: :zap:
https://www.honeybadger.io/for/laravel/?utm_source=github&utm_medium=readme&utm_campaign=laravel&utm_content=website-url
MIT License
41 stars 17 forks source link

SSL CA bundle not found #88

Closed joshuap closed 2 years ago

joshuap commented 3 years ago

A customer reported getting this message when testing Honeybadger in production:

Write HONEYBADGER_API_KEY to .env: ✔
Write HONEYBADGER_API_KEY placeholder to .env.example: ✔
Write HONEYBADGER_VERIFY_SSL placeholder to .env.example: ✔

There was an error sending the payload to Honeybadger: SSL CA bundle not found:

@shalvah (or anyone else)—any ideas on this? We bundle a ca-cert in our honeybadger-ruby gem; is that something we could provide w/ PHP, or can it be configured on the server?

Front logo Front conversations

jonzenor commented 3 years ago

Just some info on my environment:

This same version of PHP and Laravel are used in my test environment where the Honeybadger artisan command works, but my test environment does not use SSL.

shalvah commented 3 years ago

Hmmm. Guzzle provides a verify option that lets you specify a custom CA bundle (although I've only ever seen .pem files used, but the Ruby lib uses .crt, even though the contents appear to be equivalent).

@jonzenor you can download the ca-bundle.crt file from the Ruby library here, then place it somewhere in your repo and pass the absolute path to it to the client.verify option in your honeybadger.php and try again. Tried it and there were no issues.

shalvah commented 3 years ago

Be sure to config:clear after editing the config file.

jonzenor commented 3 years ago

It turns out that all I had to do was set HONEYBADGER_VERIFY_SSL to true in my .env file... In my local (dev) environment only the HONEYBADGER_API_KEY was added to .env when I ran the install commands, but both verify_ssl and api_key were added to my .env.example. So when I deployed to development for the first time, the verify_ssl config setting was added to .env (because the original .env was copied from .env.example) but it was set to blank. I didn't see any instructions telling me to set it, so I just left it at its default setting.

So in .env I changed this: HONEYBADGER_VERIFY_SSL=

To this: HONEYBADGER_VERIFY_SSL=true

Now it works.

shalvah commented 3 years ago

Ah, thanks. That is strange. Will take a look at the mechanics and docs around HONEYBADGER_VERIFY_SSL.