{% extends "console/base.html" %} {% load ostium_ui %} {% block title %}证书{% endblock %} {% block breadcrumb %}证书{% endblock %} {% block page_header %}
{% icon "certificate" "w-3.5 h-3.5" %} TLS 证书

证书

Hysteria2 与 Trojan 的 TLS 凭据。支持手动导入、自签与 certbot 同步;到期会阻止配置应用。

{% csrf_token %}
{% icon "upload" %} 导入证书
{% endblock %} {% block content %}
{% icon "shield" %} 续期状态
{% if certificate_status.certbot.available %} {% if certificate_status.certbot.active %}certbot.timer 活跃{% else %}certbot.timer 未运行{% endif %} {% else %} systemd 不可用 {% endif %}
控制台入口证书
{% if certificate_status.entrypoint.cert_days is not None %} {{ certificate_status.entrypoint.cert_days }} 天后到期 {% elif certificate_status.entrypoint.configured %} 暂时无法读取 {% else %} 未配置公网地址 {% endif %}
certbot.timer
{{ certificate_status.certbot.detail }}
线路证书
{{ certificate_status.inventory.total }} 张 · 30 天内到期 {{ certificate_status.inventory.expiring_30d }} · 已过期 {{ certificate_status.inventory.expired }}
{% if records %}
{% for cert in records %}
{{ cert.domain }}
{{ cert.get_source_display }}
{{ cert.get_status_display }}
{{ cert.days_remaining }}d
到期时间
{{ cert.expires_at|datetimefmt }}
指纹 {{ cert.fingerprint_sha256|shorthash:16 }}
签发者{{ cert.issuer|truncatechars:24 }}
自动续期{% if cert.auto_renew %}certbot{% else %}手动{% endif %}
线路{{ cert.inbounds.count }} 条
{% if cert.last_error %}
{{ cert.last_error|truncatechars:120 }}
{% endif %}
{% csrf_token %}
{% endfor %}
{% else %}
{% icon "certificate" %}
还没有导入证书
Hysteria2 与 Trojan 需要可信 TLS 证书。可以手动导入 PEM,或让 certbot 续期后通过 deploy hook 自动同步。
{% endif %}
{% icon "terminal" %} certbot 自动同步

安装时若启用 certbot,deploy hook 会在每次续期后执行:

ostium cert sync --dir /etc/letsencrypt/live

同步会校验证书链、域名与私钥匹配,并自动触发配置更新。到期 ≤30 天会在总览告警。

{% endblock %}