虫言虫语 虫言虫语

本地自签证书测试https

in 默认分类read (140754) 文章转载请注明来源!

参考文章:https://www.2cto.com/article/201510/444706.html
生成密钥、证书
第一步,为服务器端和客户端准备公钥、私钥

生成服务器端私钥 openssl genrsa -out server.key 1024

生成服务器端公钥 openssl rsa -in server.key -pubout -out server.pem

生成客户端私钥 openssl genrsa -out client.key 1024

生成客户端公钥 openssl rsa -in client.key -pubout -out client.pem 第二步,生成 CA 证书

生成 CA 私钥 openssl genrsa -out ca.key 1024

X.509 Certificate Signing Request (CSR) Management. openssl req -new -key ca.key -out ca.csr

X.509 Certificate Data Management. openssl x509 -req -in ca.csr -signkey ca.key -out ca.crt 在执行第二步时会出现:

➜ keys openssl req -new -key ca.key -out ca.csr 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 State or Province Name (full name) [Some-State]:Zhejiang Locality Name (eg, city) []:Hangzhou
Organization Name (eg, company) [Internet Widgits Pty Ltd]:My CA
Organizational Unit Name (eg, section) []: Common Name (e.g. server
FQDN or YOUR name) []:localhost Email Address []:

注意,这里的 Organization Name (eg, company) [Internet Widgits Pty Ltd]: 后面生成客户端和服务器端证书的时候也需要填写,不要写成一样的!!!可以随意写如:My CA, My Server, My Client。

然后 Common Name (e.g. server FQDN or YOUR name) []: 这一项,是最后可以访问的域名,我这里为了方便测试,写成 localhost ,如果是为了给我的网站生成证书,需要写成 barretlee.com 。

第三步,生成服务器端证书和客户端证书

服务器端需要向 CA 机构申请签名证书,在申请签名证书之前依然是创建自己的 CSR 文件 openssl req -new -key server.key -out server.csr

向自己的 CA 机构申请证书,签名过程需要 CA 的证书和私钥参与,最终颁发一个带有 CA 签名的证书 openssl x509 -req -CA ca.crt -CAkey ca.key -CAcreateserial -in server.csr -out server.crt

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

client 端到 CA 签名 openssl x509 -req -CA ca.crt -CAkey ca.key -CAcreateserial -in client.csr -out client.crt

jrotty WeChat Pay

微信打赏

jrotty Alipay

支付宝打赏

文章二维码

扫描二维码,在手机上阅读!

发表新评论
已有 26172 条评论
  1. cializS
    cializS
    回复

    [url=https://5cialismg.com/]buy cialis toronto[/url] cialis webmd

  2. JoeDes
    JoeDes
    回复

    buy gabapentin online tadalafil female 150 mg wellbutrin where to buy viagra pills online sildenafil generic buy generic plaquenil tetracyclin

  3. cializS
    cializS
    回复

    buy cialis online best price udenafil vs cialis

  4. international pharmacies that ship to the usa

    drugstore online
    http://canadiannextpharmacy.com/
    reputable mexican pharmacies online

  5. demedclscal
    demedclscal
    回复

    cialis inhaltsstoffe cialis 10 mg 28 stück cialis rezept vom hausarzt
    wie oft mit cialis

  6. cialifS
    cialifS
    回复

    [url=https://cialisgf.com/]how to buy cialis online uk[/url] cialis motto

  7. Speedycash
    Speedycash
    回复

    easy payday loan direct cash loans online application loans contact number payday loan lenders not brokers online payday loans kansas private loans

  8. JamesEsorn
    JamesEsorn
    回复

    viagra Without a Doctor Prescription medications without a doctor's prescription
    over the counter ed medication http://genericvgrshop.com viagra only 0.2$
    prescription viagra without a doctor generic viagra without a doctor prescription

  9. JdbxSkype
    JdbxSkype
    回复

    original viagra for sale purchase viagra online no prescription needed red viagra http://llviabest.com/ - viagra 50mg ’

  10. pharmacy online

    canadian pharmacies that ship to us
    http://canadiannextpharmacy.com/
    best online canadian pharmacy

  11. cializS
    cializS
    回复

    cialis without prescriptions canada price of cialis with insurance

  12. AnnaDes
    AnnaDes
    回复

    cialis online drugstore tetracycline cost

  13. Yfqan51
    Yfqan51
    回复

    generic viagra 100mg
    https://viaprescription.com

  14. JoeDes
    JoeDes
    回复

    gabapentin 300mg cap clomid 50mg buy uk lexapro generic buy online dapoxetine generic

  15. online pharmacy

    safe online pharmacies
    http://canadiannextpharmacy.com/
    mexican border pharmacies

  16. tamoxifen 10 mg coupon

    order spiriva spiriva 9 mcg united kingdom spiriva 9mcg purchase

  17. cializS
    cializS
    回复

    [url=https://5cialismg.com/]generic cialis 20 mg tadalafil[/url] cialis pharmacy pricing

  18. JamesEsorn
    JamesEsorn
    回复

    generic viagra without a doctor prescription meds without a doctor prescription
    male erection pills http://genericvgrshop.com medications without a doctor's prescription
    viagra only 0.2$ generic viagra

  19. MiaDes
    MiaDes
    回复

    average cost viagra where to buy viagra usa buy ventolin australia viagra online generic canada how to buy cialis safely online

  20. JackDes
    JackDes
    回复

    levitra tabs online pharmacy without prescription atarax for hives avana 200mg doxycycline hyclate 100 mg neurontin 200 mg tablets how to buy clomid uk lasix 60

博客已萌萌哒运行
© 2021 由 Typecho 强力驱动.Theme by Yodu
前篇 后篇
雷姆
拉姆