中国站
帮助中心 > 安全 > SSL安全证书 > 常见问题 > centOS系统生成csr

centOS系统生成csr

1.查看是否安装httpd和SSL(如果有就可以进行下一步)

  1. [root@localhost ~]# rpm -qa | grep httpd
  2. httpd-tools-2.2.15-47.el6.centos.4.x86_64
  3. [root@localhost ~]# rpm -qa | grep ssl
  4. openssl-1.0.1e-42.el6_7.4.x86_64
  5. openssl-devel-1.0.1e-42.el6_7.4.x86_64
  6. docbook-style-dsssl-1.79-10.el6.noarch
  7. mod_ssl-2.2.15-47.el6.centos.4.x86_64
  8. nss_compat_ossl-0.9.6-1.el6.x86_64

2.生成服务器私钥(以abc.cn为例)

  1. [root@localhost /]# cd /opt
  2. [root@local opt]# openssl genrsa -out abc.cn.key 2048
  3. Generating RSA private key, 2048 bit long modulus
  4. ...............+++
  5. ...............+++
  6. e is 65537 (0x10001)

3.用私钥server.key文件生成证书请求文件csr

  1. [root@local opt]# openssl req -new -out abc.cn.csr -sha256 -key abc.cn.key
  2. You are about to be asked to enter information that will be incorporated
  3. into your certificate request.
  4. There are quite a few fields but you can leave some blank
  5. For some fields there will be a default value,
  6. If you enter '.', the field will be left blank.

  1. Country Name (2 letter code) [XX]:CN #国家
  2. State or Province Name (full name) []:zhejiang #省份
  3. Locality Name (eg, city) [Default City]:hangzhou #城市
  4. Organization Name (eg, company) [Default Company Ltd]:22 #公司名称/个人直接填写姓名
  5. Organizational Unit Name (eg, section) []:22 #部门名称/个人直接填写姓名
  6. Common Name (eg, your name or your server's hostname) []:abc.cn #需要申请的域名
  7. Email Address []:22@22.cn
  8. Please enter the following 'extra' attributes
  9. to be sent with your certificate request #提示你输入一个密码,不用理他直接回车
  10. A challenge password []:
  11. An optional company name []:
  12. [root@local opt]#