1.Gmail-> 設定->設定->帳戶和匯入->變更帳戶設定->其他 Google 帳戶設定。
3. [允許安全性較低的應用程式] 設定處於啟用狀態->設定為開啟。
1. 切換目錄
$cd /etc/apache2/ssl
2. 產生RSA Private Key,建議不要設密碼,否則 Apache 伺服器程式啟動時,讀取憑證和 Private Key 時就會詢問一次密碼。(key)
$sudo openssl genrsa -out apache.key 2048
$sudo chmod og-rwx apache.key
3. 產生憑證申請書。(csr)
憑證申請書,是把您的資料,和這個 Public Key 夾在一起,以便認證中心審核,簽上簽名用的。
$sudo openssl req -new -key apache.key -out apache.csr
Country Name (2 letter code) [AU]:TW
State or Province Name (full name) [Some-State]:Taiwan R.O.C Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []: Common Name (e.g. server FQDN or YOUR name) []: //憑證的名稱(*重要*) Email Address []: //申請單位的聯絡信箱 Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:按 Enter 直接跳過 //申請書的密碼 An optional company name []:按 Enter 直接跳過 //憑證代辦公司的名稱
檢查csr,Signature Algorithm是不是sha256WithRSAEncryption。
$openssl req -text -in apache.csr -noout
4. 產生有效期1年的伺服器憑證,繞過 CA 自己簽名的證書。(crt)
$sudo openssl x509 -req -days 365 -in apache.csr -signkey apache.key -out apache.crt
檢查crt,Signature Algorithm是不是sha256WithRSAEncryption。
$openssl x509 -text -in apache.crt -noout
5. 簽完憑證,憑證申請書就不用了,可以刪掉。
$sudo rm apache.csr
|
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
|
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:!RC4 (在此屬性後面增加「:!RC4」)
SSLProtocol all -SSLv3
|
Listen 80
<IfModule ssl_module>
Listen 443
</IfModule> |