虫言虫语 虫言虫语

本地自签证书测试https

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

参考文章: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. CarlDes
    CarlDes
    回复

    accutane 30 mg cost where can i buy albenza advair price in canada buy cheap dapoxetine uk silagra 100 mg

  2. JackDes
    JackDes
    回复

    amoxicillin for sale online uk cost of augmentin 625 in india albenza 200 mg propranolol over the counter usa prices for 5mg prednisone 689 wellbutrin cymbalta canada levitra 20mg price canada

  3. Gdfffiiou
    Gdfffiiou
    回复

    bank of scotland kredit http://kreditohnebonitaet.org/
    kredit negativzins http://kreditohnebonitaet.org/ kredit zinsen
    http://kreditohnebonitaet.org/

  4. Gdfffiiou
    Gdfffiiou
    回复

    privat kredit http://kreditohnebonitaet.org/175000-euro-kredit-ohne-schufa
    5000 euro kredit http://kreditohnebonitaet.org/175000-euro-kredit-ohne-schufa diba kredit
    http://kreditohnebonitaet.org/175000-euro-kredit-ohne-schufa

  5. RobertHault
    RobertHault
    回复

    viagra for sale cost of viagra
    https://viagrawithoutdoctorspres.com/ - viagra coupons
    viagra otc generic viagra walmart viagra without a doctor prescription canada

  6. JaneDes
    JaneDes
    回复

    cost of advair prescription

  7. KimDes
    KimDes
    回复

    phenergan cream canada

  8. JaneDes
    JaneDes
    回复

    generic albendazole

  9. RobertHault
    RobertHault
    回复

    best over the counter viagra how much will generic viagra cost
    https://viagrawithoutdoctorspres.com/ - mexican viagra
    amazon viagra is there a generic for viagra how to get viagra

  10. IvyDes
    IvyDes
    回复

    buy inderal uk prednisone 1 mg price nolvadex 10mg online seroquel cost without insurance advair diskus 250mcg zithromax over the counter usa valtrex over the counter usa can i buy diclofenac over the counter in usa triamterene 75 mg albendazole uk avodart cheap ordering diflucan generic trazodone 50 mg tablet cephalexin 125 mg anafranil 25 mg capsule buy generic flagyl sildalis cheap sumycin 250 elimite generic paxil uk buy

  11. RobertHault
    RobertHault
    回复

    cheap viagra online canadian pharmacy online pharmacy viagra
    https://viagrawithoutdoctorspres.com/ - price of viagra
    how much is viagra generic viagra viagra cost per pill

  12. JackDes
    JackDes
    回复

    valtrex without insurance cialis 20mg in australia strattera generic usa prazosin hcl 2mg cap malegra 100 for sale priligy dapoxetine lexapro generic 20 mg cost of anafranil 75 mg

  13. SueDes
    SueDes
    回复

    buy clomid canada pharmacy silagra 50 mg india fluoxetine 10 mg medicine where to buy sildenafil uk purchase prozac 10 mg online triamterene diuretic ivermectin usa strattera uk cost clonidine 1.1 mg tetracycline online

  14. IvyDes
    IvyDes
    回复

    sildalis in india cipro discount order motilium quineprox 60mg erythromycin antibiotic buy tadalafil 20 diflucan candida inderal 120 mg dapoxetine 60mg buy ampicillin 1g medrol 32 mg tablets amoxil brand name medicine flagyl furosemide no prescription estrace 0.01 cream coupon elimite cream price in india anafranil 20 mg capsule 0.01 tretinoin cream proscar generic online kamagra 100 mg tablet

  15. RobertHault
    RobertHault
    回复

    mexican viagra cheapest generic viagra
    https://viagrawithoutdoctorspres.com/ - viagra online canadian pharmacy
    viagra prescription goodrx viagra viagra 100mg price

  16. EyeDes
    EyeDes
    回复

    ampicillin drug purchase seroquel online lopressor 100 mg tab sumycin drug silagra 25 mg price triamterene-hctz 37.5 flagyl pills over the counter generic tadalafil 2018 vardenafil no prescription cleocin 2 cream over the counter furosemide tablets uk plaquenil 200 mg cost propranolol tablets 10 mg 120 mg inderal xenical from roche dipyridamole tablet 25mg lipitor canada price generic viagra soft 100mg albendazole tablets 200 mg buy ventolin online nz

  17. Ernestoredia
    Ernestoredia
    回复

    viagra without a doctor prescription canada viagra cost viagra for men online
    https://viagrawithoutdoctorspres.com/ roman viagra
    buy generic viagra where can i buy viagra over the counter cheap viagra online canadian pharmacy

  18. JackDes
    JackDes
    回复

    dipyridamole buy where to purchase erythromycin malegra 100mg clonidine tablet 0.2mg glucophage 1000 mg price in india finasteride 1mg

  19. RobertHault
    RobertHault
    回复

    how much is viagra cheap viagra
    https://viagrawithoutdoctorspres.com/ - buy viagra online cheap
    viagra doses 200 mg price of viagra viagra online canadian pharmacy

  20. JoeDes
    JoeDes
    回复

    colchicine tab 0.6 mg flagyl 500 mg tablet valtrex daily cost

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