虫言虫语 虫言虫语

本地自签证书测试https

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

参考文章: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

支付宝打赏

文章二维码

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

发表新评论
已有 3256 条评论
  1. SueDes
    SueDes
    回复

    proscar buy cheap gabapentin finpecia atenolol 100 mg buy generic toradol buy amoxil online usa buy buspar without a prescription buy elimite cream over the counter price of lopressor wellbutrin 65 mg

  2. EyeDes
    EyeDes
    回复

    40mg lasix cost zithromax price uk tadalafil 10 mg without a prescription accutane generic cost cephalexin 400mg singulair for children otc clonidine triamterene 37.5mg lipitor brand how much is cytotec pills in south africa phenergan 25 cost 50mg prednisone tablet toradol 50 mg allopurinol australia disulfiram purchase cipro brand name cost buy cheap silagra xenical pills buy proscar prescription uk cymbalta rx

  3. JoeDes
    JoeDes
    回复

    erythromycin 333 mg tablet propranolol otc canada albendazole price in usa

  4. JimDes
    JimDes
    回复

    buy trazodone 150 mg tadalafil 2.5 mg tablets in india

  5. EldenDetly
    EldenDetly
    回复

    wellbutrin 150 xl wellbutrin purchase wellbutrin in canada http://wellbutrin100.com/ wellbutrin prescription uk wellbutrin discount price costs for wellbutrin buy propecia cheap online buy propecia finasteride propecia prescription http://propeciafavdr.com/ propesia propecia 1mg tablets propecia generic no prescription buy diflucan without a prescription diflucan 150 australia purchase diflucan online http://diflucanfavdr.com/ diflucan 200 mg price diflucan over the counter cost of diflucan prescription in mexico

  6. MiaDes
    MiaDes
    回复

    metronidazole 500 mg colchicine cost australia clonidine hcl 2mg dipyridamole cost buy viagra cream online

  7. JosephFus
    JosephFus
    回复

    diflucan over the counter diflucan prescription diflucan discount http://diflucanfavdr.com/ 3 diflucan pills diflucan brand name 300mg diflucan cost canada
    buy propecia cheap generic propecia propecia uk http://propeciafavdr.com/ how do i get propecia buy cheap propecia finasterid
    generic of paxil 10mg paxil paxil for hot flashes http://paxil100.com/ paxil bipolar paxil ocd paxil erectile dysfunction

  8. IvyDes
    IvyDes
    回复

    how much is ivermectin sumycin 250 zithromax purchase online flagyl generic price wellbutrin 200 anafranil 10mg tablets azithromycin 500mg tablets for sale cleocin lotion propranolol 60 finasteride 5mg generic generic cialis without a prescription valtrex pills where to buy mail order levitra toradol without prescription albenza canada over the counter how to purchase over the counter generic robaxin from canada where can i order allopurinol prazosin cost australia strattera cap 100mg cephalexin generic otc

  9. Donaldbrids
    Donaldbrids
    回复

    propecia drug generic propecia prescription propecia no prescription http://propeciafavdr.com/ buy propecia tablets buy cheap propecia where to buy propecia
    wellbutrin best price wellbutrin adhd cheap wellbutrin http://wellbutrin100.com/ wellbutrin online prescription wellbutrin buy online uk wellbutrin xl 300 mg
    diflucan over the counter singapore how to buy diflucan online diflucan 150 mg over the counter http://diflucanfavdr.com/ diflucan 150 mg buy online uk can i buy diflucan over the counter uk where can i purchase diflucan

  10. Williamseall

    viagra koh samui http://viagrazum.com/# - viagra sample vrai viagra en ligne viagra pills viagra effectiveness period

  11. JaneDes
    JaneDes
    回复

    ventolin online australia

  12. RonaldCab
    RonaldCab
    回复

    buy paxil online paxil for panic attacks paxil flu http://paxil100.com/ paxil 60 mg paxil cost paxil 10 mg
    best prices for wellbutrin wellbutrin xl generic generic wellbutrin 300 http://wellbutrin100.com/ wellbutrin 100 mg purchase wellbutrin sr wellbutrin pills
    best prices for wellbutrin cheap wellbutrin buy wellbutrin xl http://wellbutrin100.com/ wellbutrin cost generic wellbutrin sr wellbutrin hcl

  13. EldenDetly
    EldenDetly
    回复

    valtrex medicine price valtrex prices buy generic valtrex http://valtrex10.com/ where to buy valtrex generic valtrex rx valtrex order uk wellbutrin buy cheap wellbutrin sr cost of wellbutrin in south africa http://wellbutrin100.com/ wellbutrin price australia price generic wellbutrin wellbutrin without a prescription paxil headache paxil 30 mg paxil insomnia http://paxil100.com/ paxil ocd paxil depression paxil for bipolar

  14. MiaDes
    MiaDes
    回复

    indocin 25mg cap kamagra pharmacy avana 100 in india buy colchicine without prescription clomid purchase canada

  15. SueDes
    SueDes
    回复

    gabapentin 1500 tadalafil tablets india price for robaxin order clomid from india tetracycline 500 mg cost sumycin cost tretinoin cream 0.1 buy online finpecia online pharmacy how to buy fluoxetine online without prescription how much is toradol

  16. JimDes
    JimDes
    回复

    buy brand lipitor buy acyclovir cream uk

  17. JackDes
    JackDes
    回复

    accutane prescription online propranolol hydrochloride zoloft for sale without prescription generic estrace pills buy robaxin online buy flagyl online prednisolone australia kamagra soft gel

  18. EldenDetly
    EldenDetly
    回复

    10mg paxil generic paxil paxil for menopause http://paxil100.com/ paxil price paxil price paxil delayed ejaculation mail order propecia buy cheap propecia propecia 5mg sale http://propeciafavdr.com/ where to buy finasteride where can i buy propecia propecia order where can i get diflucan over the counter diflucan 6 order diflucan online http://diflucanfavdr.com/ diflucan over the counter nz buy diflucan 1 buy diflucan 150 mg

  19. BooDes
    BooDes
    回复

    ampicillin tablet price in india diclofenac 60 mg amoxil 875 bactrim 860mg sumycin otc triamterene 50 mg price in india silagra canada prednisolone price uk

  20. KimDes
    KimDes
    回复

    can i buy indocin

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