Answer the question
In order to leave comments, you need to log in
Why does Curl connect via Https from a local open server, but not from a hosting?
I use the API of one bank, Curl connects via Https from the local open server, but not from the hosting?
At the same time, it connects to https://ya.ru normally and from the hosting.
Where to dig?
Here is the function that receives the response from the bank.
function get_fcontent($jsonParams,$amount,$orderNumber,$event_name)
{
function gateway($method, $data) {
$curl = curl_init(); //
curl_setopt_array($curl, array(
CURLOPT_URL => GATEWAY_URL.$method, //
CURLOPT_RETURNTRANSFER => true, //
CURLOPT_POST => true, // POST
CURLOPT_POSTFIELDS => http_build_query($data) //
));
$response = curl_exec($curl); //
var_dump(curl_getinfo($curl));
/*echo $response; */
var_dump(curl_error($curl));
$response = json_decode($response, true); // JSON
curl_close($curl); //
return $response; //
}
$data = array(
'userName' => USERNAME,
'password' => PASSWORD,
'orderNumber' => urlencode($orderNumber),
'amount' => urlencode($amount),
'returnUrl' => RETURN_URL ,
'language' => 'en',
'failUrl' => FAILURL,
'jsonParams' => $jsonParams,
'
'description' => 'Event participation fee: '.$event_name
);
$response = gateway('register.do', $data);
return $response;
}
As a result, it was decided by adding CURLOPT_SSLVERSION => 6
as a result, now the NSS error: client certificate not found (nickname not specified)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question