Hallo,
Ik ben bezig met cURL om een aanvraag te doen naar een server.
De server heeft een (gratis, letsencrypt) certificaat.
Ik gebruik onderstaande code:
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIE, $session);
curl_setopt($ch, CURLOPT_URL, 'https://www.test.nl/nl/index.php' );
curl_setopt($ch, CURLOPT_REFERER, 'https://www.test.nl/nl/index.php');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
$data = curl_exec($ch);
echo "<hr>";
print_r($data);
echo "<hr>";
var_dump(curl_error($ch));
var_dump(curl_getinfo($ch));
Toon Meer
Ik krijg de volgende error:
tring(60) "SSL read: error:00000000:lib(0):func(0):reason(0), errno 104" array(26) { ["url"]=> string(36) "https://www.test.nl/nl/index.php" ["content_type"]=> NULL ["http_code"]=> int(0) ["header_size"]=> int(0) ["request_size"]=> int(246) ["filetime"]=> int(-1) ["ssl_verify_result"]=> int(0) ["redirect_count"]=> int(0) ["total_time"]=> float(0.017412) ["namelookup_time"]=> float(0.00016) ["connect_time"]=> float(0.001803) ["pretransfer_time"]=> float(0.011763) ["size_upload"]=> float(0) ["size_download"]=> float(0) ["speed_download"]=> float(0) ["speed_upload"]=> float(0) ["download_content_length"]=> float(-1) ["upload_content_length"]=> float(0) ["starttransfer_time"]=> float(0) ["redirect_time"]=> float(0) ["redirect_url"]=> string(0) "" ["primary_ip"]=> string(14) "12.23.
45.67" ["certinfo"]=> array(0) { } ["primary_port"]=> int(443) ["local_ip"]=> string(14) "44.55.66.77" ["local_port"]=> int(41618) }
Ik heb al gebruik gemaakt van de CURLOPT_SSL_VERIFYHOST en CURLOPT_SSL_VERIFYPEER functies in PHP maar kom er niet uit.
De website is zonder https niet te bereiken.
De data is niet belangrijk, dus het uitzetten van deze 'check?' is voor mij een goeie oplossing.
Iemand een idee hoe dit is op te lossen?
Pekeltje