Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiled SSL Error #8

Open
vmitchell85 opened this issue May 29, 2024 · 3 comments
Open

Compiled SSL Error #8

vmitchell85 opened this issue May 29, 2024 · 3 comments

Comments

@vmitchell85
Copy link

I have a Laravel Zero project that I've used Haulable for. The commands run, which is great, but I've gotten a error with my HTTP call.

Error Message:

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libc
  url/c/libcurl-errors.html) for https://__REDACTED__

Code:

use Illuminate\Support\Facades\Http;
//...
Http::withHeader('Apikey', 'REDACTED')
    ->withHeader('User-Agent', 'REDACTED')
    ->get($url);

To test I updated my HTTP call to use withoutVerifying() and withOptions(["verify"=>false]), recompiled, re-hauled (is that a word?), and it then runs without the SSL error.

Working Code:

use Illuminate\Support\Facades\Http;
//...
Http::withoutVerifying()
    ->withOptions(["verify"=>false])
    ->withHeader('Apikey', 'REDACTED')
    ->withHeader('User-Agent', 'REDACTED')
    ->get($url);

I would prefer to keep the SSL verification if possible.

Thanks in advance for your awesome package and your help.

@joecampo
Copy link
Contributor

Hey @vmitchell85! I have a couple ideas, let me give this a try.

I'm about to publish some updates for this project (been tied up with family/work).

@joecampo
Copy link
Contributor

joecampo commented Jun 7, 2024

@vmitchell85 I think I figured this out. The issue is that once compiled, it can't find the path to the system CA bundle.

The easiest way I found to solve it is to use https://github.com/composer/ca-bundle. Composer was nice enough to extract this to its own package.

Then in your app, you can use it like so:

use Composer\CaBundle\CaBundle;

Http::withOptions(['verify' => CaBundle::getSystemCaRootBundlePath()])
    ->get('https://api.ipify.org/');

@vmitchell85
Copy link
Author

Thanks @joecampo ... I'll give it a shot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants