虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

发表新评论
已有 18435 条评论
  1. Payday Loans
    Payday Loans
    回复

    good payday loans

  2. EvaDes
    EvaDes
    回复

    generic propecia online cheap

  3. low price cialis online pharmacy paypal

    brand name levitra cheap
    female pink viagra
    cialis prescription free roani Cloup

  4. AnnaDes
    AnnaDes
    回复

    viagra over the counter lyrica 75 mg price in canada synthroid.com safe place to buy viagra cheap cialis 10mg viagra 10mg price retin a singapore price lexapro pharmacy

  5. lasSa
    lasSa
    回复

    lasix bula injetavel lasix 40 mg buy effect lasix

  6. Yeqdea
    Yeqdea
    回复

    very cheap viagra http://cialistedp.com/ how to cure ed Klyezl tjbaix

  7. CarlosCob
    CarlosCob
    回复

    Обеспечиваю Заработок производителям, благодаря рекламе в Pinterest https://youtu.be/b_i8uomkv4U от 7000 до 100 000 usd в месяц в Etsy

  8. SueDes
    SueDes
    回复

    how can i get doxycycline over the counter lexapro 15 tadalafil 6mg generic plaquenil where to buy cheap generic viagra cialis online safe phenergan australia over the counter 100mg sildenafil online propecia singapore price generic zithromax india

  9. SamDes
    SamDes
    回复

    canadian pharmacy online levitra buy sildenafil citrate how to order viagra from mexico synthroid 0.1 mg sildenafil paypal finasteride prescription uk buy prednisone online uk

  10. SueDes
    SueDes
    回复

    ivermectin cream 5% price of levitra in canada buy viagra online united states how much does ivermectin cost chloroquine 500 tadalafil 7.5 mg genuine viagra online usa cheap levitra canada amoxicillin pill where to buy prednisone in canada

  11. lasSa
    lasSa
    回复

    lasix contraindicated sulfa allergy [url=https://lasixmg500.com/]price for lasix[/url] lasix la thuoc gi

  12. JoeDes
    JoeDes
    回复

    where can i buy levitra in canada augmentin without prescription zithromax z pack

  13. NickDes
    NickDes
    回复

    generic zithromax online zithromax generic pharmacy best pharmacy cheap levitra cheap propecia finasteride cialis 200

  14. can you buy promethazine hydrochloride over the counter

    what does a fake viagra pill look like
    viagra experiences
    can i buy retin a over the counter in uk roani Cloup

  15. AnnaDes
    AnnaDes
    回复

    best buy viagra online viagra over the counter uk hydroxychloroquine 50 mg levitra prescription from canada cost of zithromax 500 mg tadalafil 5 mg tablet where can i get clomid over the counter

  16. lasSa
    lasSa
    回复

    lasix kidney function test lasix to buy in the uk taking lasix and spironolactone together

  17. KimDes
    KimDes
    回复

    how to buy female viagra online

  18. JackDes
    JackDes
    回复

    buy ventolin tablets online where can i get zithromax

  19. JimDes
    JimDes
    回复

    tretinoin 0.5 cream uk foreign pharmacy no prescription online pharmacy discount code 2018 synthroid 100 mcg price buy zithromax 1000mg online generic cialis without a prescription levitra comparison order propecia usa

  20. AnnaDes
    AnnaDes
    回复

    tadalafil 20mg online can i buy viagra online in uk order cialis online canada buy clomid online uk paypal prednisone 10mg tablets

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