差異處
這裏顯示兩個版本的差異處。
| 兩邊的前次修訂版 前次修改 下次修改 | 前次修改 | ||
| tech:apache_ssl [2009/06/17 07:27] – jonathan | tech:apache_ssl [2009/11/02 14:03] (目前版本) – jonathan | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| + | ====== Apache 設定雙向 SSL 認證方式 ====== | ||
| + | * 需要自己產生免費 Server 憑證,請參考 **[[tech: | ||
| + | * 將產生的 ServerCA.crt, | ||
| + | cp ServerCA.crt / | ||
| + | cp ServerCA.key / | ||
| + | cp RootCA.crt / | ||
| + | cd / | ||
| + | chmod og-rwx ServerCA.crt | ||
| + | chmod og-rwx ServerCA.key | ||
| + | chmod og-rwx RootCA.crt | ||
| + | </ | ||
| + | ===== - 設定 Apache 內的 ssl.conf ===== | ||
| + | <code sh> | ||
| + | vi / | ||
| + | </ | ||
| + | < | ||
| + | : | ||
| + | LoadModule ssl_module modules/ | ||
| + | : | ||
| + | SSLMutex default | ||
| + | : | ||
| + | SSLCertificateFile / | ||
| + | SSLCertificateKeyFile / | ||
| + | SSLCACertificateFile / | ||
| + | : | ||
| + | SSLVerifyClient require | ||
| + | SSLVerifyDepth | ||
| + | : | ||
| + | </ | ||
| + | ==== - 如果要設定免輸入 Pin Code 啟動 Apache ==== | ||
| + | < | ||
| + | openssl rsa -in / | ||
| + | Enter pass phrase for private/ | ||
| + | writing RSA key <- 完成 | ||
| + | </ | ||
| + | |||
| + | <code sh> | ||
| + | vi / | ||
| + | </ | ||
| + | < | ||
| + | : | ||
| + | SSLCertificateKeyFile / | ||
| + | : | ||
| + | </ | ||
| + | ==== - 如果要設定廢止憑證 CRL 相關資訊 ==== | ||
| + | - 可以在 ssl.conf 內增加以下參數< | ||
| + | : | ||
| + | SSLCARevocationFile / | ||
| + | : | ||
| + | </ | ||
| + | - 下載 crl 檔加入 / | ||
| + | openssl crl -inform PEM -in trysoft.crl -text -CAfile / | ||
| + | cat CRL.pem >> / | ||
| + | </ | ||
| + | - 更改 ssl.conf 要重新啟動 Apache 才會生效, | ||
| + | [jonathan@pd920 certs]$ curl --cert ClientCA.pem https:// | ||
| + | Enter PEM pass phrase: | ||
| + | curl: (35) error: | ||
| + | </ | ||
| + | |||
| + | ===== - 重新啟動 Apache 就可完工 ===== | ||
| + | <code sh> | ||
| + | service httpd restart | ||
| + | </ | ||
| + | |||
| + | ===== 參考網址 ===== | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | |||
| + | {{tag> | ||