在positivessl.com购买下来的安全证书,直接使用到网站上在PC上是没有任何问题的,但是在手机上用chrome或者firefox打开,会说证书危险,不被信任的问题,这个原因是因为positivessl.com下载的证书,没有包含根证书和中间证书,只要把comodo给的根证书,中间证书追加到证书后面就可以认证安全了:
cat STAR_domain_com.crt AddTrustExternalCARoot.crt PositiveSSLCA2.crt >> STAR_domain_com.crt
之后这个新的证书就可以所有浏览器认证安全了,下面是对应的配置
Apache中的SSL证书的配置:
SSLEngine on
SSLCertificateFile /path/to/STAR_domain_com.crt
SSLCertificateKeyFile /path/to/STAR_domain_com.key
SSLCertificateChainFile /path/to/PositiveSSLCA2.crt
Nginx中的SSL证书的配置:
ssl on;
ssl_certificate STAR_domain_com.crt;
ssl_certificate_key STAR_domain_com.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;