Hello everybody,
I have decided to make this post to many different forums in hopes that a concrete answer can be found. My problem will probably seem familair to anyone who has ever used cURL for POST form processing over SSL before.
I have checked the cURL mailing lists, the php.net bug areas, openssl developer lists and anywhere else i can think of and I have tried things ranging from recompiling older/newer versions of libcurl, openssl, apache etc to reworking portions of code completely and I am at a loss as to the following problem.
What seems to be a recurring (but not consistent) problem is that every 3-5 customers making a purchase using the form i have created to post form data using curl to authorizenet get either complete timeouts or this cryptic error:
SSL: error:00000000:lib(0):func(0):reason(0)
I have heard that this is an openssl error. i have heard that specifying the ssl version # fixes it. i have heard that php 4.0.6 is to blame and that the newest CVS works. i have heard that current version of libcurl is to blame. I have a lot of things and acted on all them only to continue receiving the errors. PLEASE HELP!! I am completely out of ideas. Although I am pretty sure it is not a code problem I will include some of the code anyways:
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL,"https://secure.authorize.net/gateway/transact.dll");
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURL_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDSIZE, 0);
curl_setopt ($ch, CURLOPT_TIMEOUT, 20);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_REFERER, "https://63.214.181.73/"); // this can be anything so long as it is added to the 'URL management' list in au.net's admin area
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt ($ch, CURLOPT_SSLVERSION, 3);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $request);
$result = curl_exec ($ch);
$curl_array = curl_getinfo($ch);
while (list ($key, $val) = each ($curl_array)) {
$curl_key .= $key . '+';
$curl_val .= $val . '+';
}
$curl_errors = curl_error($ch);
curl_close ($ch);
$fields = explode(",", $result);
$x_response_code = $fields['0'];
$x_response_subcode = $fields['1'];
$x_response_reason_code = $fields['2'];
$x_response_reason_text = $fields['3'];
$x_auth_code = $fields['4'];
$x_avs_code = $fields['5'];
$x_trans_id = $fields['6'];
$x_Invoice_Num = $fields['7'];
// something went wrong so redirect for later batch processing
if ($x_response_code == "") {
echo '<script language="javascript">';
echo 'top.location.href="' . HTTPS_SERVER . PROGRAM_FILENAME . '/' . $url_co_brand_name . '/' . $url_affiliate_num . '/' . $url_program_num . '/' . '?' . tug_get_all_get_params() . 'curl_error_key=' . $curl_key . '&curl_error_value=' . $curl_val . '&curl_error=' . $curl_errors . '&x_response_code=61"';
echo '</script>';
tug_exit();
}