diff --git a/README.md b/README.md index 98c14aa..383b687 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ | `ssl_deploy_guide.md` | SSL 憑證部署 SOP | | `ssl_certs/` | SSL 憑證檔案(.cer、中繼憑證) | | `reset_npm_password.sh` | NPM 管理員密碼重設腳本 | +| `check_ssl.sh` | 憑證狀態檢查腳本(主機名匹配 + 到期天數) | ## 伺服器架構 @@ -33,3 +34,19 @@ ssh hospital_media ``` > 需於 `~/.ssh/config` 設定跳板機,詳見 `ssh_config.md`。 + +## 憑證檢查 + +`check_ssl.sh` 部署於 `hospital_web:~/check_ssl.sh`,本機亦保留同一份作版控。 +結束碼:`0` 正常 / `1` 連線失敗 / `2` 已過期 / `3` 即將到期 / `4` CN/SAN 不符。 + +```bash +# 預設檢查 tpesupporter.tpech.gov.tw:443 +ssh hospital_web '~/check_ssl.sh' + +# 指定其他網域 / 調整警告閾值(預設 30 天) +ssh hospital_web 'WARN_DAYS=14 ~/check_ssl.sh other.example.com 443' +``` + +> GCA G3 根憑證不在 Linux 預設信任庫,`openssl verify` 回 code 20 屬正常; +> 腳本不把它列為失敗條件。