Good time!
I need connect to https server
Admin send me the certificate file: certificat.cer
As I known, I need certificat,pem
Make *.pem
openssl x509 -outform pem -in certificate.cer -out certificate.pem
Now write php-code:
<?php
include_once('vendor/autoload.php');
$params=array();
use \Guzzle\Http\Client;
$url='
https://very.frendly.server.com';
$client = new Client($url,
array(
'Content-Type' => 'application/json',
'curl.options' => array(
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_SSLCERT => 'certificate.pem'
),
'ssl.certificate_authority' => 'system',
)
);
$request = $client->post(
$path,
array(
'Content-Type' => 'application/json'
),
json_encode($params)
);
...and get:
[curl] 58: unable to set private key file
Where error? In code? In certificate? In DNA?