Skip to content

Commit 1b3ad1c

Browse files
authored
Update CA certificate file naming in test_curl.php (Cacti#63)
1 parent f54b724 commit 1b3ad1c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

includes/test_curl.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
+-------------------------------------------------------------------------+
2323
*/
2424

25+
$user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36';
26+
$ca_info = $config['base_path'] . '/plugins/servcheck/cert/ca-bundle.crt';
2527

2628
function curl_try ($test) {
2729
global $user_agent, $config, $ca_info, $service_types_ports;
@@ -118,7 +120,7 @@ function curl_try ($test) {
118120
}
119121

120122
if ($test['ca_id'] > 0) {
121-
$ca_file = $config['base_path'] . '/plugins/servcheck/tmp_data/ca_cert_' . $test['ca_id'] . '.pem'; // The folder /plugins/servcheck/tmp_data does exist, hence the ca_cert_x.pem can be created here
123+
$ca_file = $config['base_path'] . '/plugins/servcheck/tmp_data/ca_cert_' . $test['id'] . '_' . $test['ca_id'] . '.pem';
122124
servcheck_debug('Preparing own CA chain file ' . $ca_file);
123125
// CURLOPT_CAINFO is to updated based on the custom CA certificate
124126
$options[CURLOPT_CAINFO] = $ca_file;

0 commit comments

Comments
 (0)