虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

发表新评论
已有 4656 条评论
  1. IvyDes
    IvyDes
    回复

    buy aralen uk where can i buy cytotec online citalopram hbr 40 mg tablets purchase amoxicillin 500 mg proscar cheap tadalafil 20mg generic plaquenil cost buy zofran finasteride cheap stromectol price usa paroxetine pills 40 mg buy generic lasix how much is abilify ciprofloxacin 250 mg price erythromycin cost australia anafranil sale chloroquine tablet 500mg generic tadacip buying cipro online sildenafil buy usa

  2. EvaDes
    EvaDes
    回复

    suhagra for sale

  3. KimDes
    KimDes
    回复

    ciprofloxacin 100mg

  4. Kennethmab
    Kennethmab
    回复

    kamagra viagra fr http://withoutdrprescriptions.com/ - viagra without prescription
    insurance health viagra without prescription
    wrist blood pressure cuff when does viagra go generic

  5. SueDes
    SueDes
    回复

    citalopram online viagra 200mg price order viagra online without prescription biaxin without prescription tizanidine cost in mexico zestoretic 20 25 mg 6 metformin buspar 15 mg tizanidine cost in mexico purchase cheap viagra

  6. Lzuhmag
    Lzuhmag
    回复

    viagra email virus 2010 https://canadian1pharmacy.com pharmacy online https://medshall.com/# viagra pills from india

  7. SamDes
    SamDes
    回复

    how to get phenergan viagra 500mg price viagra in usa trental 100 mg

  8. JackDes
    JackDes
    回复

    cost of generic benicar ivermectin 4000 mcg order generic proscar

  9. MiaDes
    MiaDes
    回复

    drug effexor 25 propranolol 20 mg tablet price benicar buy viagra 100mg tablet price in india ivermectin 0.08

  10. SamDes
    SamDes
    回复

    prazosin hcl for sleep zoloft 25 mg

  11. GeorgeClimi
    GeorgeClimi
    回复

    plaquenil: buy plaquenil - hydroxychloroquine buy online https://plaquenil400.com/ hydroxychloroquine for sale plaquenil for sale buy plaquenil online plaquenil for sale

  12. NickDes
    NickDes
    回复

    plaquenil 100 mg tablets best price benicar amitriptyline 100 mg cost glucophage cost uk nexium 20 mg tablet ivermectin 0.08

  13. fgti04
    fgti04
    回复

    primary health care provider near me viagra type of medication : http://viagrabun.com/# viagra online

  14. EvaDes
    EvaDes
    回复

    tadalafil 5mg uk

  15. AnnaDes
    AnnaDes
    回复

    baclofen 832 flomax 30277 buy lasix water pill brand name cymbalta viagra 20 mg daily wellbutrin 50 pill plaquenil nz

  16. JoeDes
    JoeDes
    回复

    buy plaquenil in india how much is augmentin tadacip best price diclofenac 100mg tablet generic zofran online cheap cipro online how to buy amoxicillin online lariago

  17. Kennethdem
    Kennethdem
    回复

    generic cialis black 800mg cheap cialis
    https://cialisfavdrug.com/# what is cialis used for
    cialis prices 20mg cialis generic taking l-citrulline and cialis together

  18. JimDes
    JimDes
    回复

    generic albendazole online sildenafil uk over the counter

  19. AnnaDes
    AnnaDes
    回复

    how to get paxil online viagra pills cheap online medrol 8mg price

  20. JudyDes
    JudyDes
    回复

    order generic zoloft online viagra 50 mg pill trental 400 online buy viagra from india pharmacy viagra otc uk kamagra oral jelly buy online india quineprox 50 cafergot 1 100 mg aralen tab 150 mg hydroxychloroquine sulfate 300 mg

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