Commit 1e3249a2 authored by Chanon.u's avatar Chanon.u
Browse files

Fix issue send cURL with unverify SSL

parent 3c6e6e4a
...@@ -18,8 +18,6 @@ class SpnConfigController extends Controller ...@@ -18,8 +18,6 @@ class SpnConfigController extends Controller
curl_setopt($ch, CURLOPT_URL, "$link/spn/login_api.php"); curl_setopt($ch, CURLOPT_URL, "$link/spn/login_api.php");
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Disable peer verification
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // Disable host verification
// Set the Authorization header for Basic Auth // Set the Authorization header for Basic Auth
curl_setopt($ch, CURLOPT_HTTPHEADER, [ curl_setopt($ch, CURLOPT_HTTPHEADER, [
...@@ -32,6 +30,14 @@ class SpnConfigController extends Controller ...@@ -32,6 +30,14 @@ class SpnConfigController extends Controller
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
//dd($response, $error, $httpCode); //Debug response of cURL //dd($response, $error, $httpCode); //Debug response of cURL
if ($error) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Disable peer verification
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // Disable host verification
$response = curl_exec($ch);
$error = curl_error($ch); // Check for errors
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
}
curl_close($ch); // Close the cURL handle curl_close($ch); // Close the cURL handle
if($httpCode == '404'){ if($httpCode == '404'){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment