如果您希望在指令行模式中建立自我簽署憑證,請遵循本小節中的說明。若要使用憑證精靈建立憑證,請參閱透過 Administration Console 取得憑證。
以超級使用者的身份登入或成為超級使用者 (root)。
在 /opt/SUNWmsgsr/config/sslpassword 中指定 certutil 的憑證資料庫密碼。例如:
# echo "password" > /opt/SUNWmsgsr/config/sslpassword |
其中 password 是您特定的密碼。
移至 sbin 目錄,並產生憑證資料庫 (cert8.db) 和金鑰資料庫 (key3.db)。例如:
# cd /opt/SUNWmsgsr/sbin # ./certutil -N -d /opt/SUNWmsgsr/config -f /opt/SUNWmsgsr/config/sslpassword |
產生預設的自我簽署根憑證授權單位憑證。範例:
# ./certutil -S -n SampleRootCA -x -t "CTu,CTu,CTu" -s "CN=My Sample Root CA, O=sesta.com" -m 25000 -o /opt/SUNWmsgsr/config/SampleRootCA.crt -d /opt/SUNWmsgsr/config -f /opt/SUNWmsgsr/config/sslpassword -z /etc/passwd |
產生主機的憑證。例如:
../certutil -S -n Server-Cert -c SampleRootCA -t "u,u,u" -s "CN=hostname.sesta.com, o=sesta.com" -m 25001 -o /opt/SUNWmsgsr/config/SampleSSLServer.crt -d /opt/SUNWmsgsr/config -f /opt/SUNWmsgsr/config/sslpassword -z /etc/passwd |
其中 hostname.sesta.com 是伺服器主機名稱。
驗證這些憑證。例如:
# ./certutil -V -u V -n SampleRootCA -d /opt/SUNWmsgsr/config # ./certutil -V -u V -n Server-Cert -d /opt/SUNWmsgsr/config |
列示這些憑證。例如:
# ./certutil -L -d /opt/SUNWmsgsr/config # ./certutil -L -n Server-Cert -d /opt/SUNWmsgsr/config |
使用 modutil 來列出可用的安全性模組 (secmod.db)。例如:
# ./modutil -list -dbdir /opt/SUNWmsgsr/config |
如範例所示,將憑證資料庫檔案的所有者變更為郵件伺服器使用者和群組。
chown mailsrv:mail /opt/SUNWmsgsr/config/cert8.db chown mailsrv:mail /opt/SUNWmsgsr/config/key3.db |
重新啟動郵件傳送服務以啟用 SSL。
之前,憑證和金鑰檔案總是位於 Messaging Server 配置目錄中。現在,可以使用 local.ssldbpath (指定憑證和金鑰檔案位置) 和 local.ssldbprefix (指定憑證和金鑰檔案字首) 來指定這些檔案的位置)