I'm need to know how to write the follow CURL command in PHP, I tried it from various modes and I searched in many articles here in the StackOverflow and I tried to adaptate the code but nothing is really working:
curl -v --insecure --cert public-certified-with-chain.pem --key private-key.key -nodes GET "MY_URL" "accept: */*"
I managed to reach this stage, but it doesn't work:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://...');
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
$result = curl_exec($ch);
echo $result;
The code above is simplified, it return a result, but still showing "Unauthorized".
How to adapt it to attach the files?