php-guzzleHow to disable SSL verification with Guzzle in PHP?
To disable SSL verification with Guzzle in PHP, you can use the verify
option in the request configuration array. This option takes a boolean value, where false
will disable SSL verification.
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://example.com', [
'verify' => false
]);
The code above will create a new Guzzle client and make a GET request to https://example.com
with SSL verification disabled.
$client = new GuzzleHttp\Client();
creates a new Guzzle client.$response = $client->request('GET', 'https://example.com', [
makes a GET request tohttps://example.com
with the following options.'verify' => false
disables SSL verification.
Helpful links
More of Php Guzzle
- How to use PHP Guzzle to make a batch request?
- How to set a user agent in PHP Guzzle?
- How to troubleshoot cURL error 60 with Guzzle in PHP?
- What version of PHP is required for Guzzle?
- How to use Promises with PHP Guzzle (with an example)?
- How to set a timeout for a request with PHP Guzzle?
- How to add a bearer token in PHP Guzzle?
- How to add an authorization header bearer in PHP Guzzle?
- How to update PHP Guzzle?
- How to handle a RequestException with PHP Guzzle?
See more codes...