I've just started using Zend 2 and it works really well (locally) but I can't get it to pass data via https to another server.
I'm a bit of a noob when it comes to ssl certs and I think this is where the problem lies. I've got a CERT, a Private Key and a CA cert - these are being used for an ssl cert on one of our vhost domains on our server the locations are : -
SSLCertificateFile /usr/local/psa/var/certificates/cert-####
SSLCACertificateFile /usr/local/psa/var/certificates/cert-####
In every example I read they're in '/etc/ssl/certs/ca-bundle.pem'. My question is how to I stick them together to create this .pem file that zend 2 wants? I've tried just creating a .pem file with all the -----BEGIN CERTIFICATE----- the hash/key -----END CERTIFICATE----- in and named it ca-bundle.pem but now Apache throws 'Unable to set verify locations' error at me, how do I get this to work ? Here is a snippet of the code I have for the adapter : -
$adapter = new Zend\Http\Client\Adapter\Socket();
$adapter->setStreamContext(array(
'ssl' => array(
'verify_peer' => true,
'allow_self_signed' => false,
'cafile' => '/usr/local/psa/var/certificates/ca-bundle.pem',
'verify_depth' => 5,
'CN_match' => 'https://www.mydomain.co.uk'
)
));
$client->setAdapter($adapter);
Thanks,
Joe