cURL และ HTTPS


น้องที่ทำงาน request แจ้งมาว่า ใช้ NuSOAP แล้ว Server ไม่สามารถเรียกใช้ https ได้ ตรวจสอบดูพบว่า NuSOAP ใช้ cURL นี่เอง

วิธีติดตั้งก็ไม่ได้ยากเลย แค่ enable openssl extension เท่านั้นเอง

extension=php_curl.dll
extension=php_openssl.dll

ก็ใช้ได้ดี ทดสอบง่ายๆ กับ scripts ด้านล่างนี้

 

<?php
$ch = curl_init();
//curl_setopt($ch, CURLOPT_URL, "https://www.verisign.com/");
//curl_setopt($ch, CURLOPT_URL, "https://adwords.google.com/");
//curl_setopt($ch, CURLOPT_URL, "https://www.paypal.com");
//curl_setopt($ch, CURLOPT_URL, "https://www.enom.com");
curl_setopt($ch, CURLOPT_URL, "https://domains.live.com/");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_VERBOSE,true);
curl_exec($ch);
curl_close($ch);
?>

 

คำสำคัญ (Tags): #computer#php#curl#http#ssl
หมายเลขบันทึก: 53411เขียนเมื่อ 5 ตุลาคม 2006 14:28 น. ()แก้ไขเมื่อ 12 มิถุนายน 2012 11:12 น. ()สัญญาอนุญาต: จำนวนที่อ่านจำนวนที่อ่าน:


ความเห็น (0)

ไม่มีความเห็น

พบปัญหาการใช้งานกรุณาแจ้ง LINE ID @gotoknow
ClassStart
ระบบจัดการการเรียนการสอนผ่านอินเทอร์เน็ต
ทั้งเว็บทั้งแอปใช้งานฟรี
ClassStart Books
โครงการหนังสือจากคลาสสตาร์ท