I enabled www-ssl service and create a self-sign certificate.
I can get a response from my router in cmd through this command
curl -k -u user:pass https://router_ip/rest/system/resource
but when I try to access it from my PHP code it says
My PHP code are bellowError:SSL certificate problem: self signed certificate in certificate chain
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://router_ip/rest/interface/ether1');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_USERPWD, 'user' . ':' . 'pass');
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);