SSL Certificate Test: Difference between revisions
Appearance
| Line 146: | Line 146: | ||
[[Category:Web Dev]] [[Category:Tool]] [[Category:Security]] | [[Category: Web Dev]] | ||
[[Category: Tool]] | |||
[[Category: Security]] | |||
[[Category: Revised with LLMs]] | |||
Revision as of 11:24, 3 November 2026
SSL 憑證測試
SSL 憑證測試的線上服務
定期檢查 SSL 憑證的線上服務
Secure Certificate Monitoring - LetsMonitor.org [Last visited: 2023-02-17]
SSL 憑證測試線上掃描服務
SSL Server Test (Powered by Qualys SSL Labs): Example report of SSL Report: certbot.eff.org [Last visited: 2022-05-11]
- SSL Checker - SSL Certificate Verify: Example report of SSL Checker - SSL Certificate Verify [Last visited: 2017-08-29]
- OpenSSL Command Line Utilities [Last visited: 2017-02-21]
- Testing for Weak SSL/TLS Ciphers, Insufficient Transport Layer Protection (OTG-CRYPST-001) - OWASP [Last visited: 2017-09-04]
- RapydBlok INSPECT - Audit SSL|TLS Security 報告看起來跟 drwetter/testssl.sh: Testing TLS/SSL encryption anywhere on any port 提供的一樣 [Last visited: 2021-09-11]
SSL 憑證測試掃描工具
- drwetter/testssl.sh: Testing TLS/SSL encryption anywhere on any port License: GNU General Public License v2.0
在自己電腦 SSL 憑證測試
以下以 example.com 為例,檢查網站憑證、伺服器提供的憑證鏈,以及實際驗證結果。
1. 查看伺服器提供的憑證鏈
openssl s_client \
-connect example.com:443 \
-servername example.com \
-showcerts \
</dev/null
查看 Certificate chain:
s::憑證主體。i::憑證簽發者。- 每張憑證的簽發者,應能銜接下一張憑證的主體。
- 根憑證通常不需要由伺服器傳送。
列出憑證鏈不代表已通過信任驗證。
2. 查看憑證期限、序號與指紋
openssl s_client \
-connect example.com:443 \
-servername example.com \
</dev/null 2>/dev/null |
openssl x509 -noout \
-subject -issuer -serial -dates -fingerprint -sha256
重點欄位:
| 欄位 | 檢查用途 |
|---|---|
subject | 憑證主體 |
issuer | 簽發者 |
notBefore/notAfter | 有效期間 |
serial | 憑證序號 |
SHA256 Fingerprint | 比對更新前後是否為同一張憑證 |
指紋不同,表示網站憑證已更換;指紋相同但鏈不同,可能只是修正了憑證鏈。
3. 驗證憑證信任與網域名稱
openssl s_client \
-connect example.com:443 \
-servername example.com \
-verify_hostname example.com \
-verify_return_error \
</dev/null
成功時應看到:
Verification: OK
Verified peername: example.com
Verify return code: 0 (ok)
這表示通過本機 OpenSSL 使用的信任庫與網域驗證,不等於所有用戶端皆能通過,也不代表已完成撤銷狀態檢查。
4. 使用 curl 驗證 HTTPS 請求
curl -sS -o /dev/null \
-w "HTTP=%{http_code} ssl_verify=%{ssl_verify_result}\n" \
https://example.com/
例如:
HTTP=200 ssl_verify=0
HTTP=200:首頁請求成功。ssl_verify=0:憑證驗證成功。
其他 HTTP 狀態碼不一定代表 SSL 有問題,例如 301、302 表示轉址。若要跟隨轉址,可加入 -L:
curl -sS -L -o /dev/null \
-w "URL=%{url_effective} HTTP=%{http_code} ssl_verify=%{ssl_verify_result}\n" \
https://example.com/
檢測時不要使用 -k 或 --insecure,否則會跳過憑證驗證。
5. 使用 SSL Labs 進行外部檢測
1. 前往 SSL Server Test (Powered by Qualys SSL Labs) (範例:example.com 檢測結過)
2. 確認:
- 選擇重新測試,避免只查看舊快取。
- 測試時間晚於憑證更新時間。
- 沒有憑證不受信任、過期或網域不符警告。
- 展開
Certification Paths,確認能連到受信任根憑證。 - 若網站有多個 IP,確認各端點的結果。
顯示 SSL 憑證資訊
- 設定讓 Google Chrome 可直接顯示 SSL 憑證資訊教學 for Chrome
v. 30 [Last visited: 2017-08-06]
免費 SSL 憑證
Further reading
- Generate Mozilla Security Recommended Web Server Configuration Files [Last visited: 2019-03-07]
- Cipherli.st - Strong Ciphers for Apache, nginx and Lighttpd
- How to Configure Trusted Certificates | Crashtest Security [Last visited: 2022-05-11]
Web site design and development process
- Information gathering: Research surveys
- Planning: Before you start to build a website, Content development strategy | Register domain name, Choose web hosting | Information architecture | Data model: Data type, Data flow | Documentation: Request For Proposal | Licensing
- Design: CSS tools, Free fonts, Free photos, Emoji & icons
- Testing & delivery: Usability test, check browser compatibility | Web testing | Speed up websites: Web Ping, Software acceptance test plan | Promote your web
- Maintenance: Site backup & restore test, Software update (OS patch or CMS security update)
- Need help? Community, I need inspiration, Web design glossary