https证书生成方法,怎么生成https证书?

如题所述

可以使用OpenSSL工具生成自签名https证书,但是这种自己生成的https证书是不受浏览器信任的,浏览器还是会提示“不安全”提示,不介意使用。

可以选择正规CA机构颁发的https证书,申请流程如下:

第一步 提交CSR文件

选择要申请的SSL证书,提交订单,并将制生成的CSR文件提一起交。 

第二步 提交订单到证书服务机构CA 

在收到您的订单和证书请求CSR文件后,系统初步验证无误自动提交订单到证书服务机构CA。

第三步 发送验证邮件到管理员邮箱 

证书服务机构Comodo / RapidSSL / GeoTrust / Symantec / Thawte 收到证书申请文件CSR 文件系统自动发送验证邮件到域名管理员邮箱。

第四步 用户确认验证邮件 

点击邮件中的链接访问证书服务机构验证网站,查看订单信息,确认无误后点击我确认完成邮件验证。

第五步 证书机构签发证书

DV SSL一般在用户完成确认验证邮件后1-24小时签发证书;企业型证书OV SSL 与 增强型证书EV SSL需要证书服务机构人工验证,验证时间比较长,需要1-7个工作日验证通过后签发证书.

温馨提示:答案为网友推荐,仅供参考
第1个回答  2020-01-20
需要手工生成证书的情况有:

找不到可用的证书
需要配置双向SSL,但缺少客户端证书
需要对证书作特别的定制
首先,无论是在Linux下还是在Windows下的Cygwin中,进行下面的操作前都须确认已安装OpenSSL软件包。

1. 创建根证书密钥文件(自己做CA)root.key:

openssl genrsa -des3 -out root.key
输出内容为:
[lenin@archer ~]$ openssl genrsa -des3 -out root.key
Generating RSA private key, 512 bit long modulus
……………..++++++++++++
..++++++++++++
e is 65537 (0×10001)
Enter pass phrase for root.key: ← 输入一个新密码
Verifying – Enter pass phrase for root.key: ← 重新输入一遍密码

2. 创建根证书的申请文件root.csr:

openssl req -new -key root.key -out root.csr

输出内容为:

[lenin@archer ~]$ openssl req -new -key root.key -out root.csr
Enter pass phrase for root.key: ← 输入前面创建的密码
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [AU]:CN ← 国家代号,中国输入CN
State or Province Name (full name) [Some-State]:SiChuan ← 省的全名,拼音
Locality Name (eg, city) []:SiChuan ← 市的全名,拼音
Organization Name (eg, company) [Internet Widgits Pty Ltd]:MyCompany Corp. ← 公司英文名
Organizational Unit Name (eg, section) []: ← 可以不输入
Common Name (eg, YOUR name) []: ← 此时不输入
Email Address []:admin@mycompany.com ← 电子邮箱,可随意填

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []: ← 可以不输入
An optional company name []: ← 可以不输入

3. 创建一个自当前日期起为期十年的根证书root.crt:

openssl x509 -req -days 3650 -sha1 -extensions v3_ca -signkey root.key -in root.csr -out root.crt

输出内容为:

[lenin@archer ~]$ openssl x509 -req -days 3650 -sha1 -extensions v3_ca -signkey root.key -in root.csr -out root.crt
Signature ok
subject=/C=CN/ST=SiChuan/L=SiChuan/O=MyCompany Corp./emailAddress=admin@mycompany.com
Getting Private key
Enter pass phrase for root.key: ← 输入前面创建的密码

4. 创建服务器证书密钥server.key:

openssl genrsa –des3 -out server.key 2048

输出内容为:
[lenin@archer ~]$ openssl genrsa -out server.key 2048
Generating RSA private key, 2048 bit long modulus
….+++
…………………………………………..+++
e is 65537 (0×10001)

运行时会提示输入密码,此密码用于加密key文件(参数des3便是指加密算法,当然也可以选用其他你认为安全的算法.),以后每当需读取此文件(通过openssl提供的命令或API)都需输入口令.如果觉得不方便,也可以去除这个口令,但一定要采取其他的保护措施!
去除key文件口令的命令:
openssl rsa -in server.key -out server.key

5.创建服务器证书的申请文件server.csr:

openssl req -new -key server.key -out server.csr

输出内容为:

[lenin@archer ~]$ openssl req -new -key server.key -out server.req
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [AU]:CN ← 国家名称,中国输入CN
State or Province Name (full name) [Some-State]:SiChuan ← 省名,拼音
Locality Name (eg, city) []:SiChuan ← 市名,拼音
Organization Name (eg, company) [Internet Widgits Pty Ltd]:MyCompany Corp. ← 公司英文名
Organizational Unit Name (eg, section) []: ← 可以不输入
Common Name (eg, YOUR name) []: ← 服务器主机名,若填写不正确,浏览器会报告证书无效,但并不影响使用
Email Address []:admin@mycompany.com ← 电子邮箱,可随便填

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []: ← 可以不输入
An optional company name []: ← 可以不输入

6. 创建自当前日期起有效期为期两年的服务器证书server.crt:

openssl x509 -req -days 730 -sha1 -extensions v3_req -CA root.crt -CAkey root.key -CAserial root.srl -CAcreateserial -in server.csr -out server.crt

输出内容为:

[lenin@archer ~]$ openssl x509 -req -days 730 -sha1 -extensions v3_req -CA root.crt -CAkey root.key -CAcreateserial -in server.csr -out server.crt
Signature ok
subject=/C=CN/ST=SiChuan/L=SiChuan/O=MyCompany Corp./CN=/emailAddress=admin@mycompany.com
Getting CA Private Key
Enter pass phrase for root.key: ← 输入前面创建的密码

7. 创建客户端证书密钥文件client.key:

openssl genrsa -des3 -out client.key 2048

输出内容为:

[lenin@archer ~]$ openssl genrsa -des3 -out client.key 2048
Generating RSA private key, 2048 bit long modulus
……………………………………………………………………………..+++
……………………………………………………………………………………………………….+++
e is 65537 (0×10001)
Enter pass phrase for client.key: ← 输入一个新密码
Verifying – Enter pass phrase for client.key: ← 重新输入一遍密码

8. 创建客户端证书的申请文件client.csr:

openssl req -new -key client.key -out client.csr

输出内容为:

[lenin@archer ~]$ openssl req -new -key client.key -out client.csr
Enter pass phrase for client.key: ← 输入上一步中创建的密码
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [AU]:CN ← 国家名称,中国输入CN
State or Province Name (full name) [Some-State]:SiChuan ← 省名称,拼音
Locality Name (eg, city) []:SiChuan ← 市名称,拼音
Organization Name (eg, company) [Internet Widgits Pty Ltd]:MyCompany Corp. ← 公司英文名
Organizational Unit Name (eg, section) []: ← 可以不填
Common Name (eg, YOUR name) []:Lenin ← 自己的英文名,可以随便填
Email Address []:admin@mycompany.com ← 电子邮箱,可以随便填

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []: ← 可以不填
An optional company name []: ← 可以不填

9. 创建一个自当前日期起有效期为两年的客户端证书client.crt:

openssl x509 -req -days 730 -sha1 -extensions v3_req -CA root.crt -CAkey root.key -CAserial root.srl -CAcreateserial -in client.csr -out client.crt

输出内容为:

[lenin@archer ~]$ openssl x509 -req -days 730 -sha1 -extensions v3_req -CA root.crt -CAkey root.key -CAcreateserial -in client.csr -out client.crt
Signature ok
subject=/C=CN/ST=SiChuan/L=SiChuan/O=MyCompany Corp./CN=/emailAddress=admin@mycompany.com
Getting CA Private Key
Enter pass phrase for root.key: ← 输入上面创建的密码

10. 将客户端证书文件client.crt和客户端证书密钥文件client.key合并成客户端证书安装包client.pfx:

openssl pkcs12 -export -in client.crt -inkey client.key -out client.pfx

输出内容为:

[lenin@archer ~]$ openssl pkcs12 -export -in client.crt -inkey client.key -out client.pfx
Enter pass phrase for client.key: ← 输入上面创建的密码
Enter Export Password: ← 输入一个新的密码,用作客户端证书的保护密码,在客户端安装证书时需要输入此密码
Verifying – Enter Export Password: ← 确认密码

11. 保存生成的文件备用,其中server.crt和server.key是配置单向SSL时需要使用的证书文件,client.crt是配置双向SSL时需要使用的证书文件,client.pfx是配置双向SSL时需要客户端安装的证书文件

.crt文件和.key可以合到一个文件里面,把2个文件合成了一个.pem文件(直接拷贝过去就行了)
第2个回答  2019-12-19

HTTPS认证、HTTPS证书,可以在淘宝里面找到Gworg申请。

申请HTTPS证书:

    确定并且列出具体需要的域名。

    进入淘宝中找到Gworg并且选择HTTPS证书。

    根据提示完成HTTPS域名认证。

    获得HTTPS证书并且安装到服务器。

解决办法:Gworg认证并且活动和HTTPS证书。

第3个回答  2015-09-23
自己电脑生成的https证书也叫自签名证书,自从第三方CA推出免费https证书后,大家都不用自签名证书了,一是不安全,二是浏览器不信任,会提示风险。建议你去wosign等CA申请一张免费的https证书,有个ssl精灵软件可以一键部署,很简单。本回答被网友采纳
第4个回答  2018-11-27

使用OpenSSL工具可以生成,比较复杂,而且不安全,浏览器不信任。没有预算的话去申请免费的https证书啊,这里就有 ,希望能帮到你~

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网