我使用下面的代碼來訪問一個網址(URL使用https協議,並具有有效的證書)使用cURL從https讀取響應
// Initialize session and set URL.
$url = https://my url;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
// Set so curl_exec returns the result instead of outputting it.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Get the response and close the channel.
$response = curl_exec($ch);
curl_close($ch);
但輸出我得到的是這樣的:
Failed: Error Number: 60. Reason: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
有人能指導我嗎?
謝謝,至於我能理解,您提供的代碼片段將再次SSL證書?我對嗎? –
@NewBee是的,你需要嗎?還要別的嗎 ? – Dau
謝謝,我想學習的東西,現在我將嘗試解析輸出,並保存在XMl,試圖學習,學習和學習,感謝幫助男孩... –