如果要在命令行模式中创建自签名证书,请按照本节中的说明执行操作。要使用证书向导创建证书,请参见通过管理控制台获得证书。
以超级用户身份登录或成为超级用户 (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(指定证书和密钥文件的前缀)来指定这些文件的位置。)