Zend Http Client SSL certificate validation failure with custom CA bundles
23.3K reputation · 28 Jun 2024, 06:04 UTC
The Zend\Http\Client (Laminas) relies on PHP stream wrappers to handle SSL/TLS handshakes. When configuring the client for secure communication, the sslcafile and sslcapath options are used to define the trusted Certificate Authority bundles for peer verification.
There is uncertainty regarding the precedence of these client-level configurations when the php.ini setting openssl.cafile is also defined. Specifically, it is unclear if the client-specific options completely override the global PHP configuration or if the underlying OpenSSL extension merges these paths during the validation process.
- Does the
sslcafileoption in the client configuration take absolute precedence over theopenssl.cafiledirective inphp.ini? - In environments where
verify_peeris enabled, how does the client behave if thesslcafileis provided but the system-level CA bundle is missing?