虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

发表新评论 取消回复
已有 18427 条评论
  1. Kbbtnorp
    Kbbtnorp
    回复

    .cialis canadian pharmacies-24h walmart cialis price https://xz-pharmacyonline.com - online pharmacy canada ’

  2. EvaDes
    EvaDes
    回复

    cialis 5 mg

  3. order cialis wgvgvt

    viagra canada viagra dose viagra canada
    online pharmacy canada internet pharmacy

  4. medication canada rqbvon

    sildenafil canada viagra side effects canada pharmacy viagra
    cialis for sale viagra brand sale

  5. IvyDes
    IvyDes
    回复

    doxycycline capsules price in india viagra cost in mexico buy cheap propecia canada prednisone 5052 celebrex 50 mg tablet price where to buy viagra uk zyloprim 100 mg tab metformin 500mg er generic prednisolone 5mg furosemide 40 mg for sale how to get arimidex how much is zovirax cream bactrim ds price discount glucophage propecia canada

  6. reputable mexican pharmacies online

    canadian pharcharmy online
    http://canadiannextpharmacy.com/
    international pharmacies that ship to the usa

  7. JamesEsorn
    JamesEsorn
    回复

    generic viagra without a doctor prescription generic viagra without doctor's prescription
    cure ed http://genericvgrshop.com buy generic viagra
    viagra buying prescription viagra from canada

  8. demedvgrnualf

    super viagra viagra kaufen günstig paypal viagra generika online bestellen erfahrungen
    was passiert wenn frau viagra einnimmt

  9. cializS
    cializS
    回复

    buy cialis insurance cialis 5 mg double dose

  10. annmarieql69
    annmarieql69
    回复

    My new hot project|enjoy new website
    http://fattestpornstar.sickestfreeporn.amandahot.com/?delilahiphone porn shyla stylez amaeteur virgin porn free fetish barnyard porn publick woman porn chubby young porn video

  11. cheap viagra uk bvpavg

    drug world canada generic cialis in usa sample viagra
    order cheap viagra cialis at canadian pharmacy

  12. cialifS
    cialifS
    回复

    [url=https://cialisgf.com/]buy cialis united kingdom[/url] cialis 5 mg uso

  13. demedvgrnualf

    viagra dosierung online viagra viagra 100mg preis apotheke
    was passiert nach einnahme von viagra

  14. JamesEsorn
    JamesEsorn
    回复

    generic viagra without doctor's prescription meds without a doctor prescription
    cure for ed http://genericvgrshop.com buy prescription viagra
    buying prescription viagra from canada buy medication without an rx

  15. NickDes
    NickDes
    回复

    [url=http://oipharmacy.com/]medication canadian pharmacy[/url] [url=http://viagra10x.com/]viagra 200 mg online[/url] [url=http://synthroidlevo.com/]where to buy prescription synthroid[/url] [url=http://indocindrug.com/]indocin 25mg cap[/url] [url=http://lasixfurosemidepill.com/]order lasix with no prescription[/url] [url=http://tretinoinretinacream.com/]no prescription retin a[/url]

  16. SueDes
    SueDes
    回复

    [url=https://tadalafilxl.com/]buy cialis uk[/url] [url=https://tetracyclinepill.com/]terramycin eye ointment[/url] [url=https://viagravpro.com/]viagra price singapore[/url] [url=https://hicialis.com/]5mg tadalafil daily[/url] [url=https://elitadalafil.com/]cialis brand name online[/url] [url=https://viagra10x.com/]viagra 100 cost[/url] [url=https://prednisoneprednisolone.com/]50mg prednisone tablet[/url] [url=https://cymbaltadulox.com/]cymbalta buy cheap[/url] [url=https://doxycyclinerem.com/]where can you get doxycycline[/url] [url=https://ataraxhydroxyzine.com/]atarax medication[/url]

  17. JackDes
    JackDes
    回复

    [url=https://metforminsale.com/]buy metformin online[/url] [url=https://phenerganpromethazine.com/]phenergan 50 mg[/url] [url=https://indocindrug.com/]generic for indocin[/url] [url=https://azithromycinzithromax.com/]azithromycin for sale usa[/url] [url=https://atenololtenormin.com/]buy atenolol 100mg[/url] [url=https://viagrasupp.com/]sildenafil 50 mg[/url]

  18. LbgSkype
    LbgSkype
    回复

    viagra for saale how much is viagra in the uk viagra 100 uk http://genqpviag.com/ - what\'s the difference in viagra ’

  19. IvyDes
    IvyDes
    回复

    [url=https://buyazithromycinzithromax.com/]zithromax 500 mg lowest price online[/url] [url=https://zyloprimallopurinol.com/]allopurinol 100mg prices[/url] [url=https://levitravardena.com/]levitra online canada[/url] [url=https://viagramn.com/]canadian pharmacy viagra 50 mg[/url] [url=https://arimidexanastrozole.com/]arimidex generic brand[/url] [url=https://upsildenafil.com/]usa viagra over the counter[/url] [url=https://cialisdrug.com/]tadalafil 100mg online[/url] [url=https://milpharmacy.com/]indianpharmacy com[/url] [url=https://quetiapineseroquel.com/]buy seroquel generic[/url] [url=https://hydrochlorothiazidepill.com/]can i buy hydrochlorothiazide over the counter[/url] [url=https://metforminsale.com/]best metformin brand[/url] [url=https://wellbutrinabupropion.com/]wellbutrin brand coupon[/url] [url=https://viagra10x.com/]viagra online generic[/url] [url=https://avodartpill.com/]avodart 0.5[/url] [url=https://xtadalafil.com/]buy tadalafil[/url]

  20. JamesEsorn
    JamesEsorn
    回复

    viagra only 0.2$ buy prescription viagra online without
    medication for ed http://genericvgrshop.com buy medication without an rx
    buy viagra very cheap generic viagra without a doctor prescription

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