虫言虫语 虫言虫语

本地自签证书测试https

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

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

    generic for propecia propecia pill buy propecia usa http://propeciafavdr.com/ buy propecia online cheap generic finasteride 1mg no prescription where to buy propecia generic valtrex canada generic valtrex sale valtrex price without insurance http://valtrex10.com/ valtrex generic over the counter valtrex prescription canada canadian valtrex no rx valtrex prescription australia valtrex without presciption valtrex 500 mg tablet http://valtrex10.com/ cost of valtrex generic generic valtrex online without prescription generic valtrex online without prescription

  2. JimDes
    JimDes
    回复

    triamterene online cleocin for acne non prescription prednisone 20mg gabapentin 300 mg over the counter

  3. JoeDes
    JoeDes
    回复

    buy furosemide 100 mg over the counter paxil

  4. Jasonkip
    Jasonkip
    回复

    viagra young men stories http://viagrahall.com/# - viagra online viagra 100mg compare viagra en kamagra

  5. DenDes
    DenDes
    回复

    glucophage price in australia medrol 4mg tablets hydroxychloroquine medication sumycin 500 mg price in india zithromax antibiotic without prescription

  6. EldenDetly
    EldenDetly
    回复

    valtrex medication cost how much is valtrex generic order valtrex http://valtrex10.com/ how much is valtrex valtrex price australia valtrex online pharmacy india 5 mg paxil drug paxil paxil 20 mg http://paxil100.com/ paxil for children paxil cost paxil delayed ejaculation generic for paxil paxil for ocd paxil online http://paxil100.com/ generic for paxil generic paxil 20 mg paxil

  7. IvyDes
    IvyDes
    回复

    disulfiram tablets 250 mg price clonidine 0.2 pill 6mg tadalafil finpecia online india dapoxetine australia price buy chloroquine online canada tetracycline cheapest price xenical pill cheap hydrochlorothiazide trazodone 650 mg sildenafil 150 mg albenza 200 cost atenolol 25 mg tabs tretinoin cream over the counter australia paxil cheap zoloft 25 ventolin uk pharmacy colchicine cheapest price plaquenil cheap buy malegra 100 mg

  8. JimDes
    JimDes
    回复

    augmentin tablet 625mg cytotec price in south africa cymbalta 60 mg price australia cheap amoxil online

  9. SueDes
    SueDes
    回复

    robaxin without a prescription plaquenil price us trazodone 100 mg tablet propranolol inderal medrol pak 4mg atenolol medication sumycin over the counter cephalexin generic cost where to buy cleocin cream plavix 75 india

  10. JackDes
    JackDes
    回复

    cost of ivermectin cream sumycin 250 mg buy neurontin canadian pharmacy zithromax script best buspar generic ivermectin tablets dapoxetine 60 mg tablets in india

  11. JosephFus
    JosephFus
    回复

    cost of valtrex generic generic valtrex sale can you buy valtrex over the counter http://valtrex10.com/ can you buy valtrex over the counter in usa how to get valtrex prescription how much is valtrex generic
    paxil 60 mg paxil 20mg paxil online http://paxil100.com/ paxil drug cost of paxil paxil price
    over the counter valtrex cream generic valtrex canada valtrex prices http://valtrex10.com/ how much is a valtrex prescription valtrex 500 cost buy generic valtrex online canada

  12. MarkDes
    MarkDes
    回复

    dapoxetine 30 mg price in india advair pharmacy coupon how much is neurontin pills propranolol daily brand name lexapro online

  13. Donaldbrids
    Donaldbrids
    回复

    australia price for valtrex valtrex over the counter uk valtrex order canada http://valtrex10.com/ valtrex 1500 mg cost for valtrex price of valtrex in canada
    paxil headache generic for paxil paxil 10mg http://paxil100.com/ paxil cr generic paxil cr paxil 20 mg
    propecia pills propecia 1mg tablets finasterid http://propeciafavdr.com/ propecia sale finasteride online bonus finasteride price

  14. EldenDetly
    EldenDetly
    回复

    diflucan 150 cost cost of diflucan tablet diflucan 1 otc http://diflucanfavdr.com/ diflucan discount coupon diflucan in usa diflucan over the counter singapore how can i get valtrex where to buy valtrex generic valtrex 2 tablets http://valtrex10.com/ valtrex online valtrex price in canada generic for valtrex propecia 5mg buy finasteride no rx propecia women http://propeciafavdr.com/ fincar buy propecia cheap online propecia cheap

  15. RonaldCab
    RonaldCab
    回复

    paxil price paxil 30 mg paxil cr http://paxil100.com/ paxil flu paxil cr generic paxil
    cost of wellbutrin 75mg buy wellbutrin online wellbutrin 75 mg tablet http://wellbutrin100.com/ wellbutrin 450 mg wellbutrin brand price wellbutrin no prescription
    wellbutrin without a prescription cost of wellbutrin in south africa generic wellbutrin us http://wellbutrin100.com/ wellbutrin 150mg price wellbutrin drug buy wellbutrin online usa

  16. JaneDes
    JaneDes
    回复

    bactrim buy

  17. MiaDes
    MiaDes
    回复

    estrace coupon finpecia tablet price in india generic allopurinol 300 mg bactrim avana drug

  18. CarlDes
    CarlDes
    回复

    hydrochlorothiazide over the counter dapoxetine 30 mg tablet price glucophage online uk can i buy prednisolone over the counter in uk how much is a medrol 4mg

  19. KimDes
    KimDes
    回复

    where can you get clomid

  20. DenDes
    DenDes
    回复

    inderal 160 mg capsule disulfiram 250 cost cost of tretinoin cream in india nolvadex tablets india dapoxetine 60 mg buy online in india

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