You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: certificate check does not function as expected (#36)
* Update poller_servcheck.php
/* let PHP run just as long as it has to */
// modified by MSS on 2025-03-08
//ini_set('max_execution_time', '120');
* Update servcheck_process.php
Fix a bug in the certificate check
* Update servcheck_test.php
Enhancement on the graph page
* Update setup.php
Add 30 days to check the certificate validity
* Update functions.php
Finetune the graph display.
* Update tests.php
Fix bugs related to CA certificate
Fix typos
* Update CHANGELOG.md
Fix certificate check does not function as expected #35
* Update servcheck_process.php
Revise the date format.
* Update servcheck_process.php
Finetuning the date format
* Update CHANGELOG.md
Fix certificate check does not function as expected #36
* Update CHANGELOG.md
* issue#36: Fix certificate check does not function as expected
* Update functions.php
* issue#36: Fix certificate check does not function as expected
* Update tests.php
* issue#36: Fix certificate check does not function as expected
* Update servcheck_process.php
removing undesired commented lines.
* Update poller_servcheck.php
/* let PHP run just as long as it has to */
ini_set('max_execution_time', '270');
and removing sleep(2) after exec background
* Update CHANGELOG.md
issue#35: Fix certificate check does not function as expected
* Update servcheck_process.php
(isset($test['expiry_date']) ? $test['expiry_date'] : 'Invalid Expiry Date')
$ca_info = $config['base_path'] . '/plugins/servcheck/ca_cert_' . $test['ca'] . '.pem';// The folder /plugins/servcheck does exist, hence the ca_cert_x.pem can be created here
116
118
plugin_servcheck_debug('Preparing own CA chain file ' . $ca_info , $test);
119
+
// CURLOPT_CAINFO is to updated based on the custom CA certificate
120
+
$options[CURLOPT_CAINFO] = $ca_info;
117
121
118
122
$cert = db_fetch_cell_prepared('SELECT cert FROM plugin_servcheck_ca WHERE id = ?',
- when to terminate the connection - curl can't easily set "disconnect on first received message".
373
-
I callcall back and if any data is returned, the connection is terminated (42).
376
+
I call back and if any data is returned, the connection is terminated (42).
374
377
If no data is returned, the test timeouts (28)
375
378
- the data is not returned the same way as with other services, I have to capture it in a file
376
379
*/
@@ -552,9 +555,11 @@ function doh_try ($test) {
552
555
553
556
$process = curl_init($url);
554
557
555
-
if ($test['ca'] > 0) {
556
-
$ca_info = '/tmp/cert' . $test['ca'] . '.pem';
558
+
if ($test['ca'] > 0) {
559
+
$ca_info = $config['base_path'] . '/plugins/servcheck/cert_' . $test['ca'] . '.pem';// The folder /plugins/servcheck does exist, hence the ca_cert_x.pem can be created here
557
560
plugin_servcheck_debug('Preparing own CA chain file ' . $ca_info , $test);
561
+
// CURLOPT_CAINFO is to updated based on the custom CA certificate
562
+
$options[CURLOPT_CAINFO] = $ca_info;
558
563
559
564
$cert = db_fetch_cell_prepared('SELECT cert FROM plugin_servcheck_ca WHERE id = ?',
0 commit comments