自建CA证书以及导入到浏览器实现https安全连接

自建CA证书以及导入到浏览器实现https安全连接

  1. 安装 openssl(一般centos 系统都会自带安装好的了)
    目录:/etc/pki/CA/
    yum install openssl openssl-devel -y
    mkdir -pv /etc/ssl/private

  2. 由于谷歌浏览器对安全比较高要求,所以需要额外配置

[root@localhost data]# vim http.ext
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName=@SubjectAlternativeName

[ SubjectAlternativeName ]
IP.1=127.0.0.1
IP.2=192.168.32.130 #这里要和下面的IP对应一致

  1. 使用openssl 生成 SSL key 和 CSR
    [root@localhost data]# cd /home/data/

[root@localhost data]# openssl req -new -newkey rsa:2048 -sha256 -nodes -out 192.168.32.130.csr -keyout 192.168.32.130.key -subj “/C=CN/ST=Guangdong/L=GZ/O=Super Inc./OU=Web Security/CN=192.168.32.130”

[root@localhost data]# openssl x509 -req -days 3650 -in 192.168.32.130.csr -signkey 192.168.32.130.key -out 192.168.32.130.crt -extfile http.ext

  1. 将 192.168.32.130.crt 导入到 chrome 受信任的根证书颁发机构

  2. 重载 nginx 并清除 chrome 缓存访问。

猜你喜欢

转载自blog.csdn.net/Harry_z666/article/details/131055438