prosodyctl cert generate deyu.wang
0.8.2-7.el6.x86_64,prosodyctl 命令並沒有提供此一功能。所以管理者必須使用 openssl 自行產生私鑰及憑證。
[root@kvm8 ~]# openssl req -days 3650 -new -x509 -nodes \ -out deyu.wang.crt -keyout deyu.wang.key \ -subj '/C=TW/ST=Taiwan/L=CYUT/O=CSIE/CN=deyu.wang Certificate Authority'
[root@kvm8 ~]# cp deyu.wang.key /etc/pki/tls/private/ [root@kvm8 ~]# cp deyu.wang.crt /etc/pki/tls/certs/
[root@kvm8 ~]# chmod 600 /etc/pki/tls/certs/deyu.wang.crt [root@kvm8 ~]# chmod 600 /etc/pki/tls/private/deyu.wang.key [root@kvm8 ~]# chown prosody:prosody /etc/pki/tls/private/deyu.wang.key [root@kvm8 ~]# chown prosody:prosody /etc/pki/tls/certs/deyu.wang.crt
[root@kvm8 ~]# grep ^c2s /etc/prosody/prosody.cfg.lua c2s_require_encryption = true
VirtualHost "deyu.wang"
enabled = true -- Remove this line to enable this host
-- Assign this host a certificate for TLS, otherwise it would use the one
-- set in the global section (if any).
-- Note that old-style SSL on port 5223 only supports one certificate, and will always
-- use the global one.
ssl = {
key = "/etc/pki/tls/private/deyu.wang.key";
certificate = "/etc/pki/tls/certs/deyu.wang.crt";
}
[root@kvm8 ~]# prosodyctl restart Stopped Started