Skip to content
Snippets Groups Projects

update cert check validation

Merged Hahn Axel (hahn) requested to merge update-appmonitor into master
1 file
+ 13
1
Compare changes
  • Side-by-side
  • Inline
@@ -57,7 +57,7 @@ class checkCert extends appmonitorcheck
'url' => [
'type' => 'string',
'required' => true,
'description' => 'Url to check https://[server}[:{port}] or ssl://[server}[:{port}]',
'description' => 'Url to check https://[server}[:{port}] or ssl://[server}[:{port}]; autodetected on webserver with php but required on cli',
'default' => null,
'regex'=>'/^(https|ssl):\/\/[^\s]+/',
'example' => '',
@@ -86,6 +86,18 @@ class checkCert extends appmonitorcheck
],
];
/**
* Override explain()
* If https is used, url is not required because it can be autodetected from $_SERVER
*/
public function explain(): array
{
if($_SERVER['HTTPS']??false && $_SERVER['SERVER_NAME']??false){
$this->_aDoc['parameters']['url']['required']=false;
}
return $this->_aDoc;
}
/**
* Get default group of this check
* @return string
Loading