SSL Certificate Checker|SSL 证书检测

SSL 证书检测 | SSL Certificate Checker

SSL 证书检测 SSL Certificate Checker

输入域名或网址,查看 SSL/TLS 证书的有效期、颁发机构(Issuer)、主体(Subject)与 SAN 域名等信息。
Enter a domain or URL to inspect SSL/TLS certificate expiry, issuer, subject and SANs.

1. 输入参数 · Target & Options
建议优先输入域名(不带路径),可减少误差与解析歧义。
Prefer a plain domain (no path) to avoid ambiguity and reduce parsing errors.
由于浏览器安全限制,前端无法直接读取对方站点的证书详情,需要你站点后端代查。
Browsers can’t directly read remote TLS certificates. A server-side endpoint is required.
如你使用非标准 HTTPS 端口(例如 8443),请在此填写。
If your HTTPS runs on a non-standard port (e.g., 8443), specify it here.
工具会根据「剩余天数」标记状态:正常/即将到期/已过期。
The tool labels status based on days left: OK / Expiring Soon / Expired.

接口约定(推荐):GET /api/ssl-check?host=example.com&port=443,返回 JSON。你可以按 Notes 的示例快速实现。
Suggested contract: GET /api/ssl-check?host=example.com&port=443 returning JSON. A backend sample is provided in Notes.

3. 使用说明 · Notes
  • 为什么需要后端? · Why do we need a backend?
    中文:浏览器出于安全原因,不能像命令行那样直接对任意域名做 TLS 握手并读取证书链细节(Issuer、NotAfter、SAN 等)。 所以“纯前端页面”做证书检测,必须依赖:① 你自己的后端接口代查;或 ② 第三方证书查询 API(但信息可能不完全或不代表“当前在用证书”)。
    English:For security reasons, browsers can’t freely perform TLS handshakes to arbitrary hosts and expose full certificate details. A front-end SSL checker typically requires either (1) your server-side proxy API, or (2) a third-party API (which may be incomplete / not the currently served certificate).
  • 推荐的返回 JSON 字段 · Recommended JSON fields
    你站点后端接口建议返回(字段名可按需调整,前端已做容错):
    {
      “host”:”example.com”, “port”:443,
      “valid_from”:”2025-01-01T00:00:00Z”,
      “valid_to”:”2026-01-01T23:59:59Z”,
      “issuer”:”Let’s Encrypt”,
      “subject”:”CN=example.com”,
      “common_name”:”example.com”,
      “san”:[“example.com”,”www.example.com”],
      “serial_number”:”04AF…9C”,
      “signature_algorithm”:”sha256WithRSAEncryption”,
      “public_key”:”RSA 2048″,
      “tls_version”:”TLSv1.3″,
      “chain”:[“R3″,”ISRG Root X1”]
    }

    English tip: Keep times in ISO 8601 (UTC) so the UI can consistently compute “days left”.
  • 状态判断逻辑 · Status logic
    OK:剩余天数 > 预警阈值;Expiring Soon:0–阈值天;Expired:剩余天数 < 0。
    OK if days left > threshold; Expiring Soon if 0–threshold; Expired if days left < 0.
  • 一键自查(命令行) · Quick self-check (CLI)
    中文:当你怀疑“网站明明能打开,但证书提示异常”,先用命令行确认服务端实际回了什么证书:
    openssl s_client -servername example.com -connect example.com:443 </dev/null 2>/dev/null | openssl x509 -noout -issuer -subject -dates
    Windows (PowerShell) 可用 OpenSSL 或 Git Bash。
    English:When browsers show certificate warnings, confirm what the server actually presents using OpenSSL (issuer/subject/dates).
  • 常见问题排查 · Common troubleshooting
    1) SNI 没带对:同一 IP 多站点时,必须传正确域名(servername)。
    2) CDN/反代:你看到的是 CDN 的证书还是源站证书?(Cloudflare 等会终止 TLS)。
    3) 链不完整:服务端没发完整中间证书,会导致部分客户端报错。
    4) 时间错误:服务器或客户端系统时间不准,会导致“未生效/已过期”的假象。
    English: Check SNI, CDN termination, incomplete intermediates, and system time drift.

免责声明 / Disclaimer:本工具用于运维排查与学习参考,不构成安全审计或合规报告。不同客户端(浏览器/手机/老旧系统)对证书链与算法的支持差异,可能导致“同一证书,不同设备提示不同”。
This tool is for troubleshooting and education only, not a formal security audit. Different clients may validate the same certificate differently.