add timeout for curl

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-04-09 01:03:06 +02:00
parent c5a1a00e38
commit 1ce496a323

View file

@ -303,6 +303,8 @@ class ConfigurationManager
$testUrl = $protocol . $domain . ':443'; $testUrl = $protocol . $domain . ':443';
curl_setopt($ch, CURLOPT_URL, $testUrl); curl_setopt($ch, CURLOPT_URL, $testUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$response = (string)curl_exec($ch); $response = (string)curl_exec($ch);
# Get rid of trailing \n # Get rid of trailing \n
$response = str_replace("\n", "", $response); $response = str_replace("\n", "", $response);