Reputation: 3640
With Guzzle HTTP client I know you can set new GuzzleClient(['verify' => false])
to have it not check the certificate, eg. when you are using a self-signed certificate. But how can I make it accept and trust a specific self-signed certificate, so that you don't just open up for ANY certificate but only one specific one - is that possible?
Upvotes: 11
Views: 12930
Reputation: 31751
A self-signed certificate is its own authority, so simply set the verify option to the filename of the certificate:
// Use a custom SSL certificate on disk.
new GuzzleClient(['verify' => '/path/to/self-signed/cert.pem']);
http://docs.guzzlephp.org/en/stable/request-options.html#verify-option
Upvotes: 14