From 1ce496a32385e9060dbd0887cd7c76944b076a93 Mon Sep 17 00:00:00 2001 From: Simon L Date: Sun, 9 Apr 2023 01:03:06 +0200 Subject: [PATCH] add timeout for curl Signed-off-by: Simon L --- php/src/Data/ConfigurationManager.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index 6d4619ad..16b24578 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -303,6 +303,8 @@ class ConfigurationManager $testUrl = $protocol . $domain . ':443'; curl_setopt($ch, CURLOPT_URL, $testUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); + curl_setopt($ch, CURLOPT_TIMEOUT, 10); $response = (string)curl_exec($ch); # Get rid of trailing \n $response = str_replace("\n", "", $response);