How to ignore invalid SSL certificate errors in Guzzle 5

How to ignore invalid SSL certificate errors in Guzzle 5

  1. Blog
  2. 15 November 2026
  3. 2 min read

Stefan Bogdanescu

Founder & Senior Architect

How to ignore invalid SSL certificate errors in Guzzle 5

You might find a wealth of documentation explaining how to disable SSL verification in Guzzle 3, but those solutions often fail when ported to Guzzle 5. The core issue lies in how the library handles the verify parameter. If you attempt to pass 'false' directly as a string within the default client options, Guzzle interprets this value differently than a boolean or expects a specific path. This mismatch triggers a RequestException stating "SSL CA bundle not found: false" whenever you execute a request.

The error occurs because the library attempts to use the provided value as a file path for the Certificate Authority (CA) bundle rather than a flag to skip verification. To resolve this, you must explicitly pass a boolean false instead of the string 'false'. While both represent "off" in many contexts, Guzzle's internal logic distinguishes between a missing string argument and an intentional boolean directive.

Here is the correct configuration pattern for Guzzle 5:

$client = new \Guzzle\Http\Client([
    'defaults' => [
        'verify' => false
    ]
]);

By setting verify to the boolean false, you instruct the underlying cURL layer to skip peer verification entirely. This approach bypasses the need to manually manipulate curl options like CURLOPT_SSL_VERIFYHOST or CURLOPT_SSL_VERIFYPEER. In Guzzle 5, these low-level options are managed internally, and attempting to set them directly on the request object often results in unexpected behavior or deprecation warnings compared to using the high-level verify option.

It is worth noting that Guzzle 6 introduced further changes to this configuration. If you were working with a newer version of the library, the syntax shifted again, requiring the use of curl' => ['verify' => false] within the handler options. However, for the specific context of Guzzle 5, ensuring the boolean type is correct is the only necessary step to suppress the SSL error.

Disabling SSL verification should generally be treated as a temporary measure or restricted to specific testing environments. In production scenarios, ignoring certificate errors exposes your application to man-in-the-middle attacks and other significant security vulnerabilities. If you are handling sensitive data or connecting to public APIs, always ensure that the server presents a valid certificate signed by a trusted authority.

If you need to bypass this issue in a Laravel project specifically, consider checking out LaravelCompany for resources on managing secure API integrations within the framework. They often provide guidance on configuring clients safely without sacrificing code clarity.

Ultimately, the fix is straightforward: ensure you are passing a boolean false rather than a string. This small distinction prevents the library from treating your intent as a missing file path and allows your requests to proceed without triggering the SSL exception.

Our network