fix: [https] errors caught by the health element
parent
e1ac7fe2e6
commit
20027f4d69
|
@ -104,13 +104,20 @@ class MispConnector extends CommonConnectorTools
|
||||||
{
|
{
|
||||||
$settings = json_decode($connection->settings, true);
|
$settings = json_decode($connection->settings, true);
|
||||||
$http = new Client();
|
$http = new Client();
|
||||||
$response = $http->post($settings['url'] . '/users/view/me.json', '{}', [
|
try {
|
||||||
'headers' => [
|
$response = $http->post($settings['url'] . '/users/view/me.json', '{}', [
|
||||||
'AUTHORIZATION' => $settings['authkey'],
|
'headers' => [
|
||||||
'Accept' => 'Application/json',
|
'AUTHORIZATION' => $settings['authkey'],
|
||||||
'Content-type' => 'Application/json'
|
'Accept' => 'Application/json',
|
||||||
]
|
'Content-type' => 'Application/json'
|
||||||
]);
|
]
|
||||||
|
]);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return [
|
||||||
|
'status' => 0,
|
||||||
|
'message' => __('Connection issue.')
|
||||||
|
];
|
||||||
|
}
|
||||||
$responseCode = $response->getStatusCode();
|
$responseCode = $response->getStatusCode();
|
||||||
if ($response->isOk()) {
|
if ($response->isOk()) {
|
||||||
$status = 1;
|
$status = 1;
|
||||||
|
|
Loading…
Reference in New Issue