Files
gateway01/openvpn-monitor/api/tls-errors.php

21 lines
514 B
PHP

<?php
define('APP_INIT', true); // ✅ Добавлено
$path = __DIR__ . '/../src/OpenVPNMonitor.php';
if (!file_exists($path)) {
http_response_code(500);
echo json_encode(['error' => 'File not found: ' . $path]);
exit;
}
require_once $path;
header('Content-Type: application/json');
try {
$monitor = new OpenVPNMonitor();
$errors = $monitor->getTlsErrors();
echo json_encode(['tls_errors' => $errors]);
} catch (Exception $e) {
echo json_encode(['error' => $e->getMessage()]);
}