差異處
這裏顯示兩個版本的差異處。
pc:mixed:sslonapacheandtomcat [2016/02/02 23:01] tony [下載csr] |
pc:mixed:sslonapacheandtomcat [2023/06/25 09:48] |
||
---|---|---|---|
行 1: | 行 1: | ||
- | {{tag>Computer https}} | ||
- | ====== How to setup free SSL on apache and tomcat? ====== | ||
- | 其實這個問題困擾我很久,因為授權的SSL憑證幾乎都要上萬([[http://www.ssl.com.tw/products/benefit.asp|價格對照表]]),這叫小弟錢何以堪?以前用過自行授權的SSL,但在大部分瀏覽器下都會出現不安全的連線,甚至拒絕連線。而Facebook在2012年10月之後,許多使用者都採用了安全性瀏覽https,我也常常收到:「為什麼國軍倒數計時器不能用」、「不支援安全性瀏覽」等錯誤回報。之前也只能奉勸AP的使用者取消使用安全性瀏覽,如何使用私自授權的SSL,Facebook根本會拒絕連線。麻煩好朋友谷鴿一陣子後,知道 | ||
- | [[http://www.startssl.com/|StartSSL]]網站提供免費的SSL授權,也找到幾篇教學是關於申請與設定。基本上我只是把申請的過程中,有遇到問題的部分整理一下,好方便大家更容易去架站。\\ | ||
- | 主要有以下過程:\\ | ||
- | 1. 申請與設定domain name。\\ | ||
- | 2. 申請https web certification。\\ | ||
- | 3. 設定Server。\\ | ||
- | ===== 申請與設定Domain Name ===== | ||
- | 申請domain name當然使用我們電信龍頭:[[http://domain.hinet.net/|中華電信]]。我是使用個人域名(idv.tw),一年400,三年1080。在申請與付款完後,到DNS異動與查詢中進行反查的設定。在這我設定了'www.tonylin.idv.tw'與'tonylin.idv.tw',其中www做為我的subdomain。\\ | ||
- | {{:pc:mixed:domain_setting_type.png?700|}}\\ | ||
- | ===== 申請https web certification ===== | ||
- | 在[[http://hoamon.blogspot.com/2011/04/how-to-get-free-https-web-certification.html|如何使用免費的https]]中,其實已經清楚說明了申請流程。其中有幾個令我有疑惑的部分如下: | ||
- | ==== 簽核公錀 ==== | ||
- | 在輸入csr、domain與subdomain後,它會出現等待審核的畫面,並不會如教學中直接給你認證後的csr,因此你必須等待它的審核。在審核成功後,你可以在StartSSL右邊選單中看到打勾的資訊。\\ | ||
- | {{:pc:mixed:auth_domain.png?250|}}\\ | ||
- | 在這需要注意的是,一開始我的subdomain沒有審核過。後來我寫信問StartSSL原因,是由於domain name當天才被建立,可能是基於安全考量,建議我過幾天再提出申請。隔個兩天再次申請就成功了。\\ | ||
- | {{:pc:mixed:response_mail_startssl.png?800|}} | ||
- | ==== 下載csr ==== | ||
- | 由於必須通過審核,就不會像教學流程中直接顯示出certificate讓你下載。必須到Tool Box,並點擊Retrieve才會出現你的web server certificate,請把它下載為example.crt。\\ | ||
- | {{:pc:mixed:csr_retrieve.png?700|}} | ||
- | ==== Append csr ==== | ||
- | Firefox下會有sec_error_unknown_issuer的錯誤。必須下載https://www.startssl.com/certs/ca.pem與https://www.startssl.com/certs/sub.class1.server.ca.pem,並將它們內容加載到example.crt之後。 | ||
- | ===== 設定Server ===== | ||
- | 如果是使用apache http server,可以直接參考'[[http://hoamon.blogspot.com/2011/04/how-to-get-free-https-web-certification.html|如何使用免費的https?]]'。在你的config中,加入或修改如下: | ||
- | <code bash> | ||
- | SSLEngine on | ||
- | SSLProtocol all -SSLv2 | ||
- | SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM | ||
- | SSLCertificateFile /opt/startssl/example.crt | ||
- | SSLCertificateKeyFile /opt/startssl/example.key | ||
- | SSLCertificateChainFile /opt/startssl/sub.class1.server.ca.pem | ||
- | SSLCACertificateFile /opt/startssl/ca.pem | ||
- | SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown | ||
- | </code> | ||
- | 如果是使用tomcat,可參考[[http://blog.csdn.net/buyaore_wo/article/details/5771470|在tomcat上設定StartSSL憑證方法]]。把剛剛產生的example.cst和你的key合併成pfx檔案。假如你是使用StartSSL產生的key就用那個key,如果是自己產生的就把自己的key內容貼上即可。 | ||
- | ===== Facebook Setting ===== | ||
- | {{:pc:mixed:lacd_https_setting.png?700|}}\\ | ||
- | 在設定完Tomcat後,我發現根本連不到。最後發現是因為我的Router NAT忘了設定,且Server防火牆port也忘了開。真是年假放幾天,腦袋也天天。希望支援https之後,我的廣告收益一個月能破兩千阿,新電腦靠它了! | ||
- | ===== 參考網頁 ===== | ||
- | * [[http://hoamon.blogspot.com/2011/04/how-to-get-free-https-web-certification.html|如何使用免費的https?]] | ||
- | * [[http://blog.csdn.net/buyaore_wo/article/details/5771470|在tomcat上設定StartSSL憑證方法]] | ||
- | ===== ===== | ||
- | ---- | ||
- | \\ | ||
- | ~~DISQUS~~ |