虫言虫语 虫言虫语

本地自签证书测试https

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

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

    triamterene 50 mg 7 hydrochlorothiazide dipyridamole eye drops buspar 10 mg tablet buy albenza from canada lopressor 20mg zestril lisinopril buy accutane uk propranolol online uk generic viagra soft gel capsule

  2. RandallObexy
    RandallObexy
    回复

    price of viagra viagra price
    https://viagrawithoutdoctorspres.com/ - 100mg viagra

  3. RobertHault
    RobertHault
    回复

    viagra generic how to get viagra without a doctor
    https://viagrawithoutdoctorspres.com/ - where to get viagra
    viagra coupon viagra cost per pill viagra walgreens

  4. MiaDes
    MiaDes
    回复

    lisinopril no prescription wellbutrin 800mg buy cheap avodart no rx how much is advair cytotec mexico

  5. JoeDes
    JoeDes
    回复

    can you buy viagra otc advair diskus from canada clonidine sleeping pill anafranil for dogs elimite cream directions how to get priligy in usa prazosin 2mg capsules

  6. RobertHault
    RobertHault
    回复

    how to get viagra generic for viagra
    https://viagrawithoutdoctorspres.com/ - buy viagra
    how to buy viagra over the counter viagra how much viagra should i take the first time?

  7. JoeDes
    JoeDes
    回复

    generic amoxil cost kamagra 200

  8. EldenDetly
    EldenDetly
    回复

    paxil for hot flashes paxil delayed ejaculation paxil 5 mg http://paxil100.com/ paxil anxiety paxil er paxil ssri wellbutrin 540mg best price generic wellbutrin wellbutrin sr 150 http://wellbutrin100.com/ wellbutrin 450 tablet price of wellbutrin without insurance wellbutrin canadian pharmacy where can i buy wellbutrin online price of wellbutrin xl 689 wellbutrin http://wellbutrin100.com/ wellbutrin 100mg price wellbutrin 100mg tablets wellbutrin without a prescription

  9. KiaDes
    KiaDes
    回复

    indocin 50

  10. JosephFus
    JosephFus
    回复

    buy generic wellbutrin online how to get wellbutrin in australia generic for wellbutrin http://wellbutrin100.com/ cheap wellbutrin wellbutrin price australia how much is wellbutrin in canada
    buy diflucan yeast infection diflucan online paypal where can you get diflucan over the counter http://diflucanfavdr.com/ purchase diflucan online diflucan otc in canada diflucan in usa
    diflucan 150 mg tablets diflucan uk price diflucan cream over the counter http://diflucanfavdr.com/ diflucan pills prescription diflucan for sale uk buy diflucan online canada

  11. Donaldbrids
    Donaldbrids
    回复

    valtrex prescription australia generic for valtrex price of valtrex in canada http://valtrex10.com/ valtrex costs canada buy generic valtrex without prescription how much is valtrex in canada
    buy generic valtrex online purchase generic valtrex online valtrex price without insurance http://valtrex10.com/ valtrex medication for sale valtrex cream price valtrex 500 mg tablets
    150 wellbutrin cost of wellbutrin generic 75mg wellbutrin xl 300 mg http://wellbutrin100.com/ cheap wellbutrin sr cost of wellbutrin generic 75mg 250 mg wellbutrin

  12. JudyDes
    JudyDes
    回复

    ivermectin 3mg pill indocin purchase prednisone 300mg propecia over the counter uk hydroxychloroquine 700mg clonidine for tics proscar price usa lisinopril brand name cost baclofen tablet price cephalexin 219

  13. EldenDetly
    EldenDetly
    回复

    finasteride online bonus propecia hair drug finasteride http://propeciafavdr.com/ fincar propecia generic no prescription generic propecia prescription paxil for premature ejaculation paxil for depression paxil hair loss http://paxil100.com/ paxil 30 mg paxil for anxiety paxil erectile dysfunction paxil ocd drug paxil paxil depression http://paxil100.com/ paxil weight loss buy paxil online paxil erectile dysfunction

  14. JoeDes
    JoeDes
    回复

    cheapest xenical orlistat ivermectin topical albenza online azithromycin brand name in canada generic tetracycline prozac discount

  15. JaneDes
    JaneDes
    回复

    cheap prednisolne

  16. MiaDes
    MiaDes
    回复

    anafranil 25g buy fluoxetine 10 mg glucophage price canada tadalafil 2.5 mg price india acyclovir buy

  17. JackDes
    JackDes
    回复

    generic finpecia singulair buy online estrace price india where can i buy clonidine zithromax medication robaxin south africa

  18. KimDes
    KimDes
    回复

    buy cephalexin online canada

  19. AmyDes
    AmyDes
    回复

    buy indocin

  20. JudyDes
    JudyDes
    回复

    otc amoxicillin uk zoloft uk over the counter paxil cost without insurance ivermectin price comparison advair 550 avana 200mg plaquenil 75 mg finasteride 5 mg daily ventolin 2 nolvadex nz

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