Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
LemonWiki共筆
Search
Search
Appearance
Log in
Personal tools
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
SSL Certificate Test
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== SSL 憑證測試 == == SSL 憑證測試的線上服務 == <onlyinclude> 定期檢查 SSL 憑證的線上服務 * {{Gd}} [https://letsmonitor.org/ Secure Certificate Monitoring - LetsMonitor.org] {{access | date=2023-02-17}} SSL 憑證測試線上掃描服務 * {{Gd}} [https://www.ssllabs.com/ssltest/ SSL Server Test (Powered by Qualys SSL Labs)]: Example report of [https://www.ssllabs.com/ssltest/analyze.html?d=certbot.eff.org&latest SSL Report: certbot.eff.org] {{access | date=2022-05-11}} * [https://www.sslshopper.com/ssl-checker.html SSL Checker - SSL Certificate Verify]: Example report of [https://www.sslshopper.com/ssl-checker.html#hostname=certbot.eff.org SSL Checker - SSL Certificate Verify] {{access | date=2017-08-29}} * [http://possible.lv/tools/hb/ Heartbleed OpenSSL extension testing tool, CVE-2014-0160] * OpenSSL [https://wiki.openssl.org/index.php/Command_Line_Utilities Command Line Utilities] {{access | date=2017-02-21}} * [https://www.owasp.org/index.php/Testing_for_Weak_SSL/TLS_Ciphers,_Insufficient_Transport_Layer_Protection_(OTG-CRYPST-001) Testing for Weak SSL/TLS Ciphers, Insufficient Transport Layer Protection (OTG-CRYPST-001) - OWASP] {{access | date=2017-09-04}} * [https://inspect.rapydblok.com/ RapydBlok INSPECT - Audit SSL|TLS Security] 報告看起來跟 [https://github.com/drwetter/testssl.sh drwetter/testssl.sh: Testing TLS/SSL encryption anywhere on any port] 提供的一樣 {{access | date=2021-09-11}} SSL 憑證測試掃描工具 * [https://github.com/drwetter/testssl.sh drwetter/testssl.sh: Testing TLS/SSL encryption anywhere on any port] License: GNU General Public License v2.0 </onlyinclude> == 在自己電腦 SSL 憑證測試 == 以下以 <code>example.com</code> 為例,檢查網站憑證、伺服器提供的憑證鏈,以及實際驗證結果。 === 1. 查看伺服器提供的憑證鏈 === <pre lang="bash"> openssl s_client \ -connect example.com:443 \ -servername example.com \ -showcerts \ </dev/null </pre> 查看 <code>Certificate chain</code>: * <code>s:</code>:憑證主體。 * <code>i:</code>:憑證簽發者。 * 每張憑證的簽發者,應能銜接下一張憑證的主體。 * 根憑證通常不需要由伺服器傳送。 '''列出憑證鏈不代表已通過信任驗證。''' === 2. 查看憑證期限、序號與指紋 === <pre lang="bash"> openssl s_client \ -connect example.com:443 \ -servername example.com \ </dev/null 2>/dev/null | openssl x509 -noout \ -subject -issuer -serial -dates -fingerprint -sha256 </pre> 重點欄位: <table> <tr><th>欄位</th><th>檢查用途</th></tr> <tr><td><code>subject</code></td><td>憑證主體</td></tr> <tr><td><code>issuer</code></td><td>簽發者</td></tr> <tr><td><code>notBefore</code>/<code>notAfter</code></td><td>有效期間</td></tr> <tr><td><code>serial</code></td><td>憑證序號</td></tr> <tr><td><code>SHA256 Fingerprint</code></td><td>比對更新前後是否為同一張憑證</td></tr> </table> 指紋不同,表示網站憑證已更換;指紋相同但鏈不同,可能只是修正了憑證鏈。 === 3. 驗證憑證信任與網域名稱 === <pre lang="bash"> openssl s_client \ -connect example.com:443 \ -servername example.com \ -verify_hostname example.com \ -verify_return_error \ </dev/null </pre> 成功時應看到: <pre lang="text"> Verification: OK Verified peername: example.com Verify return code: 0 (ok) </pre> 這表示通過本機 OpenSSL 使用的信任庫與網域驗證,不等於所有用戶端皆能通過,也不代表已完成撤銷狀態檢查。 === 4. 使用 curl 驗證 HTTPS 請求 === <pre lang="bash"> curl -sS -o /dev/null \ -w "HTTP=%{http_code} ssl_verify=%{ssl_verify_result}\n" \ https://example.com/ </pre> 例如: <pre lang="text"> HTTP=200 ssl_verify=0 </pre> * <code>HTTP=200</code>:首頁請求成功。 * <code>ssl_verify=0</code>:憑證驗證成功。 其他 HTTP 狀態碼不一定代表 SSL 有問題,例如 <code>301</code>、<code>302</code> 表示轉址。若要跟隨轉址,可加入 <code>-L</code>: <pre lang="bash"> curl -sS -L -o /dev/null \ -w "URL=%{url_effective} HTTP=%{http_code} ssl_verify=%{ssl_verify_result}\n" \ https://example.com/ </pre> 檢測時不要使用 <code>-k</code> 或 <code>--insecure</code>,否則會跳過憑證驗證。 === 5. 使用 SSL Labs 進行外部檢測 === 1. 前往 [https://www.ssllabs.com/ssltest/ SSL Server Test (Powered by Qualys SSL Labs)] (範例:[https://www.ssllabs.com/ssltest/analyze.html?d=www.google.com Google.com 檢測結過]) 2. 確認: # 選擇重新測試,避免只查看舊快取。 # 測試時間晚於憑證更新時間。 # 沒有憑證不受信任、過期或網域不符警告。 # 展開 <code>Certification Paths</code>,確認能連到受信任根憑證。 # 若網站有多個 IP,確認各端點的結果。 == 顯示 SSL 憑證資訊 == * [https://free.com.tw/google-chrome-show-certificate-viewer/ 設定讓 Google Chrome 可直接顯示 SSL 憑證資訊教學] for {{Chrome}} v. 30 {{access | date=2017-08-06}} == 免費 SSL 憑證 == * [https://letsencrypt.org/ Let's Encrypt - Free SSL/TLS Certificates] 教學: [https://free.com.tw/ssl-for-free/ SSL For Free 免費 SSL 憑證申請,使用 Let's Encrypt 最簡單方法教學!] == Further reading == * [https://mozilla.github.io/server-side-tls/ssl-config-generator/ Generate Mozilla Security Recommended Web Server Configuration Files] {{access | date=2019-03-07}} * [https://cipherli.st/ Cipherli.st - Strong Ciphers for Apache, nginx and Lighttpd] * [https://crashtest-security.com/configure-trusted-certificates/ How to Configure Trusted Certificates | Crashtest Security] {{access | date=2022-05-11}} * [[Glossary of information security]] ---- {{Template:Build a website}} [[Category: Web Dev]] [[Category: Tool]] [[Category: Security]] [[Category: Revised with LLMs]]
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki共筆:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Access
(
view source
) (protected)
Template:Build a website
(
view source
) (semi-protected)
Template:Chrome
(
edit
)
Template:Gd
(
edit
)