Failed to connect to an API endpoint port 9443 after 105 ms: Connection refused
Hey Guys
I am struggling with a private API. I get the following error:
cURL error 7: Failed to connect to api-url-endpoing.co.za port 9443 after 105 ms: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api-url-endpoing.co.za:9443/blablabla/v1/blabla
The controller and routes are as follows:
Controller:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Http;
use App\User;
use Carbon\Carbon;
use Auth;
use DB;
use GuzzleHttp\Client;
class CreditDataController extends Controller
{
public function getAllData()
{
try{
$response = Http::post('https://api-url-endpoing.co.za:9443/blablabla/v1/blabla',
[ "auth"=> ["username"=>"*********",
"password"=>"*********"],
"system_settings"=> ["version"=>"1.0",
"origin"=>"*******"],
"search_criteria"=>["identity_number"=>"**********",
"identity_type"=>"SID",
"consent"=>"Y"]
]);
dd($response->json());
} catch (\Exception $e) {
$err= $e->getMessage();
echo 'errpor <pre>';print_r($err);exit;
}
}
}
Route:
Route::get('credit',[CreditDataController::class,'getAllData'])->name('credit.all');
What i also found is how when performing a traceroute of that api url , there is a point in which at line 7,8 & 10 there is a delay as can be seen in this video: https://we.tl/t-poa8fJucvu
also can be seen here:
traceroute to api-uat.compuscan.co.za (196.34.30.104), 64 hops max, 72 byte packets
1 192.168.0.1 (192.168.0.1) 1.875 ms 1.509 ms 1.307 ms
2 cip-isd-access-ftth-rt2 (41.87.209.2) 4.273 ms 5.135 ms 3.786 ms
3 agn-isd-core-rt-1.agn.net.za (41.87.209.30) 3.812 ms 3.662 ms 3.518 ms
4 is.ixp.joburg (196.60.8.126) 4.348 ms 4.535 ms 4.757 ms
5 ar4-pkl.ten-0-0-1-0.ip.ddii.network (196.26.0.69) 5.772 ms 5.625 ms 5.318 ms
6 mi-za-pkl-br4-ten-0-0-2-1sub304.ip.ddii.network (168.209.86.250) 8.284 ms 5.617 ms 5.549 ms
7 * * *
8 196.37.132.6 (196.37.132.6) 20.630 ms 20.595 ms 232.976 ms
9 * * *
10 * * *
11 197.96.71.3 (197.96.71.3) 22.376 ms 22.546 ms 22.404 ms
12 196.33.211.100 (196.33.211.100) 21.563 ms 22.200 ms 21.757 ms
13 196.34.30.104 (196.34.30.104) 22.215 ms 22.047 ms 22.632 ms
Worth mentioning that when performing the same request on POSTMAN everything works fine, its only when i deploy on a remote server that i encounter this issue.
For completeness i also checked the logs of the remote server my web app is hosted on and it shows the following:
https://privatebin.support-tools.com/?3d40c5a5f5aaf630#UZErd1wZ9jL8/Yi7p7feIBywteAau62EV4XIWyQucd4=
Please or to participate in this conversation.