1
When I consume an api with Curl php the following error appears: Failed to connect to demo.d4sign.com.br port 443: Timed out.
Curl’s code:
<?php
$tknAPI;
$cryptKey;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://demo.d4sign.com.br/api/v1/list?tokenAPI=' . $tknAPI . '&cryptKey=' . $cryptKey);
//curl_setopt($curl, CURLOPT_HEADER, TRUE);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Accept: application/json', 'Content-Type: application/json']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
echo $result = curl_exec($curl);
echo $err = curl_error($curl);
?>
If you are consuming an endpoint on port 443, are you using ssl, do you have the certificate installed? tried to pass the certificate as a parameter to Curl, for example
-cacert nome-do-certificado.crt
?– Ricardo Pontual
even with ssl as parameter had not returned nor anything in echo but appeared with var_dump($result); Thanks!
– Marco Antonio Sktf10