06-11-2007, 22:18
|
|
|
חבר מתאריך: 18.12.03
הודעות: 78
|
|
בעיית curl
יש לי אתר ecommerce שבו PayPal משמש כמסלקה.
אני משתמש ב-Curl כדי לתקשר עם השרת של Paypal.
זה הקוד שלי:
//setting the curl parameters.
$o_curl = curl_init() ;
curl_setopt($o_curl, CURLOPT_URL, PAYPAL_API_ENDPOINT) ;
curl_setopt($o_curl, CURLOPT_VERBOSE, 1) ;
curl_setopt($o_curl, CURLOPT_RETURNTRANSFER, 1) ;
curl_setopt($o_curl, CURLOPT_POST, 1) ;
//setting the $s_nvp_req as POST FIELD to curl
curl_setopt($o_curl, CURLOPT_POSTFIELDS, $s_nvp_req) ;
//getting response from server
$s_response = curl_exec($o_curl) ;
אני מקבל הודעת שגיאה:
error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure
הוספתי שורות קוד:
curl_setopt($o_curl, CURLOPT_SSLVERSION, 2) ;
//turning off the server and peer verification(TrustManager Concept).
curl_setopt($o_curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($o_curl, CURLOPT_SSL_VERIFYHOST, FALSE);
ועכשיו אני מקבל את הודעת השגיאה:
Error Message: error:1406C0C8:SSL routines:GET_SERVER_FINISHED peer error
הבעיה ב-ssl. השאלה מה אני צריך לבדוק ? מה חסר בקוד ?
תודה
|