虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

发表新评论
已有 4654 条评论
  1. NickDes
    NickDes
    回复

    metformin 20 mg plaquenil tablets 200mg flagyl metronidazole amoxicillin 100 mg generic paxil online pharmacy buy vermox in usa where can i buy generic periactin how to order viagra from canada

  2. Ramstalk
    Ramstalk
    回复

    tablets [url=http://cialis4walmart.com]cialis without a doctor’s prescription[/url] paketan cialis without doctor prescription dumpty

  3. GeorgeClimi
    GeorgeClimi
    回复

    hydroxychloroquine over the counter: plaquenil purchase - plaquenil cost canada https://plaquenil400.com/ hydroxychloroquine buy online plaquenil cost hydroxychloroquine over the counter hydroxychloroquine over the counter

  4. JimDes
    JimDes
    回复

    canadian pharmacy zovirax anafranil otc augmentin 500 online stromectol tab price can you buy generic viagra over the counter in canada suhagra online purchase in india effexor cost uk cheap generic viagra online canada

  5. JaneDes
    JaneDes
    回复

    where to buy metformin uk

  6. KimDes
    KimDes
    回复

    amoxicillin 500 mg price in india

  7. JackDes
    JackDes
    回复

    plaquenil depression paroxetine 10 discount viagra 100mg cipro cheapest furosemide 10 mg tablet hydroxychloroquine brand name

  8. JaneDes
    JaneDes
    回复

    viagra 5mg price

  9. EvaDes
    EvaDes
    回复

    buy viagra online europe

  10. AnnaDes
    AnnaDes
    回复

    stromectol for sale can you buy albenza over the counter clopidogrel 300 mg tablet how much is strattera in uk trazodone 6161 plaquenil 5 mg furosemide cost us

  11. Michaelkam
    Michaelkam
    回复

    payday candy bar: http://www.quicken4loans.com/ payday loan my stocks
    speedy cash payday loans online

  12. JackDes
    JackDes
    回复

    quineprox 750mg chloroson erythromycin 80mg

  13. KiaDes
    KiaDes
    回复

    tadalafil tablets cheap

  14. JerryLah
    JerryLah
    回复

    $200 cialis coupon - tadalafil
    https://tadalafilrxed.com/ cialis vs viagra

  15. JasonDes
    JasonDes
    回复

    where to buy dapoxetine in us trental 400 mg tablet price chloroquine how to get paxil hydroxychloroquine sulfate tabs citalopram tab 20mg generic cialis 2018 cost buy zestoretic sildenafil over the counter australia chloroquine tablets cost

  16. Olivernar
    Olivernar
    回复

    viagra cheap: viagra - viagra otc https://sildenafil100mega.com/ viagra generic viagra cost viagra without a doctor prescription is there a generic for viagra

  17. where to purchase lasix in Czech Republic

    cheap lasix in UK
    where can you buy lasix over the counter where to buy lasix in Switzerland http://lasifurex.com/ cheap lasix in El Paso


    where to buy lasix in UK
    what do you need to purchase lasix
    best way to take lasix
    how to buy lasix in Charlotte

  18. JaneDes
    JaneDes
    回复

    how to get sildenafil online

  19. JimDes
    JimDes
    回复

    cost of generic clindamycin levitra india price

  20. RichardExciz
    RichardExciz
    回复

    buy viagra cialis: buy viagra cialis - cost of cialis https://tadalafilrxed.com/ what is cialis cialis vs viagra effectiveness tadalafil switching from tamsulosin to cialis

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