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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With