refactor: address CommanderStorm's review feedback

- Use i18n-t for description with code tag and RFC 8446 spec link
- Add comment that TLS alert names are from spec (not translatable)
- Refactor TCP monitor into smaller functions:
  - checkTcp() for standard TCP connectivity check
  - performStartTls() for STARTTLS handshake
  - checkTlsCertificate() for TLS certificate validation
  - attemptTlsConnection() for TLS connection with alert capture
- Improve error messages with more context
This commit is contained in:
mkdev11
2026-01-06 20:29:21 +02:00
parent 327b51f304
commit dc1e96f7d1
2 changed files with 187 additions and 142 deletions
+9 -3
View File
@@ -406,6 +406,7 @@
<label for="expected_tls_alert" class="form-label">{{ $t("Expected TLS Alert") }}</label>
<select id="expected_tls_alert" v-model="monitor.expectedTlsAlert" class="form-select">
<option value="none">{{ $t("None (Successful Connection)") }}</option>
<!-- TLS alert names are from RFC 8446 spec and should NOT be translated -->
<optgroup :label="$t('TLS Alerts')">
<option value="certificate_required">certificate_required (116)</option>
<option value="bad_certificate">bad_certificate (42)</option>
@@ -417,9 +418,14 @@
<option value="certificate_revoked">certificate_revoked (44)</option>
</optgroup>
</select>
<div class="form-text">
{{ $t("expectedTlsAlertDescription") }}
</div>
<i18n-t tag="div" class="form-text" keypath="expectedTlsAlertDescription">
<template #code>
<code>certificate_required</code>
</template>
<template #link>
<a href="https://www.rfc-editor.org/rfc/rfc8446#section-6.2" target="_blank" rel="noopener noreferrer">{{ $t("TLS Alert Spec") }}</a>
</template>
</i18n-t>
</div>
</template>