您的位置:首页 > 其它

prosody IM cert证书安装

2016-02-26 14:01 495 查看
服务器是ubuntu14.04,安装的prosody是0.9.1-ubuntu。

生成证书请求,参考信息如:

root@AY140712154637Z:/var/lib/prosody# prosodyctl cert request mazclub.com
Overwrite /var/lib/prosody/mazclub.com.key?
Choose key size (2048):
Generating RSA private key, 2048 bit long modulus
..............................................+++
...............................+++
e is 65537 (0x10001)
Key written to /var/lib/prosody/mazclub.com.key
Please provide details to include in the certificate config file.
Leave the field empty to use the default value or '.' to exclude the field.
countryName (GB): CN
localityName (The Internet): mazclub, Qingdao
organizationName (Your Organisation): mazclub
organizationalUnitName (XMPP Department): im
commonName (mazclub.com):
emailAddress (xmpp@mazclub.com): im@mazclub.com


而后到startssl.com去申请,这里只使用免费方式足够。

先认证域名,未认证会自动提示



填写域名,不要写为www.xxx.com



选择自己域名的注册邮件,或者是域名为后缀的邮件地址。



填上得到的验证码,即可验证域名。

操作过程简单。

申请证书,我这里给prosody im使用,所以选择SSL/TLS。



主机我填了3个,自己的域名,自己可以定制。

把prosodyctl生成的request文件内容贴到CSR文本框中。



得到的文件解压后如下,使用OtherServer压缩包中文件:



上传到 /var/lib/prosody目录下。

使用命令:

cat Intermediate.crt >> mazclub.com.crt


生成证书链,否则连通讯都不成了。

注意使用 >> 而不是 >,前者是追加。 按=certificate#certificate_chains]prosody文档说明,站点证书在前,intermediate在后。

(Many certificate authorities=certificate#fn__1]1) provide you with an
intermediate certificate which your server must supply to clients in addition to your own
certificate so that they can verify it successfully. 多数证书授权者提供一个inermediate证书给你,你的服务器除了提供你自己的证书给客户端,还要提供intermediate证书,以使得客户端可以验证成功)

最后,重启prosody服务,让证书生效。

prosdody.cfg.lua配置文件部分设置如下:

1)指定证书路径

这里使用全局设定

ssl = {
key = "/var/lib/prosody/mazclub.com.key";
certificate = "/var/lib/prosody/mazclub.com.crt";
}


2)要求加密

c2s_require_encryption = true
allow_unencrypted_plain_auth = false
disable_sasl_mechanisms = { "DIGEST-MD5" }


3)虚拟主机

VirtualHost "mazclub.com"

--enabled = false -- Remove this line to enable this host

-- Assign this host a certificate for TLS, otherwise it would use the o$
-- set in the global section (if any).
-- Note that old-style SSL on port 5223 only supports one certificate, $
-- use the global one.
--ssl = {
--      key = "/var/lib/prosody/mazclub.com.key";
--      certificate = "/var/lib/prosody/mazclub.com.crt";
--}


这里的ssl注释掉了,使用全局ssl。



使用自签名证书,psi还让你选择一下。

这里,把证书链做成后,它相信证书是合法的。

Pidgin则不给任何选择的机会,要么是合法证书,要么是不加密的。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: