虫言虫语 虫言虫语

本地自签证书测试https

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

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

    viagra coupons 75% off viagrawithoutdoc viagra without a doctor prescription
    http://vgrmall.com/# india pharmacy viagra
    viagra side effects directions for use of viagra viagra pill

  2. JordanLex
    JordanLex
    回复

    when will generic viagra be available subscription viagra without doctor prescription http://vgrmall.com/# viagra dosage recommendations generic viagra without subscription walmart genuine viagra without a doctor prescription 100 mg viagra lowest price

  3. Semyonobete
    Semyonobete
    回复

    https://milishare.com/archives/421?unapproved=17637&moderation-hash=19d8c4cfcd93f0873f9b13e804d0021c - cialiscialis online

  4. Amitsflormror

    minimum credit score for mortgage http://checkcreditps.com/ - credit score rating free credit score report credit score

  5. Danielwat
    Danielwat
    回复

    what is viagra generic viagra coupon
    http://vgrmall.com/# genuine viagra without a doctor prescription
    how long does it take for viagra to work viagra without a doctor prescription 150 mg female viagra pills

  6. smagmevagype
    smagmevagype
    回复

    experian credit how to dispute credit report items freeze credit report

  7. swimarumTauff

    turbotax credit score http://creditcheckmax.com/ - transunion credit report dispute experian business credit report free credit report best credit score

  8. MichaelZom
    MichaelZom
    回复

    viagra online pharmacy cost of viagra per pill
    http://vgrmall.com/# generic viagra
    cheap viagra viagra dosage recommendations viagra coupon

  9. Barrygew
    Barrygew
    回复

    cost of viagra viagra prices
    http://www.nanajch.com/home.php?mod=space&uid=61976 directions for use of viagra
    viagra dosage best generic viagra websites generic viagra available in usa

  10. crapyragacoup

    free credit reports http://creditcheckweb.com/ credit report dispute annualcreditreport com experian credit score

  11. Danielwat
    Danielwat
    回复

    viagra for sale viagra
    http://www.babygoonline.com/home.php?mod=space&uid=135258 viagra dosage recommendations
    sildenafil 20 mg vs viagra real viagra without a doctor prescription viagra vs cialis

  12. JordanLex
    JordanLex
    回复

    levitra vs viagra viagrawithoutdoc viagra without a doctor prescription https://questswingersclub.co.uk/questforum/member.php?action=profile&uid=5937 viagra without a doctor prescription side effects for viagra viagra without a doctor prescription pfizer generic viagra
    viagra 100mg india pharmacy viagra http://lybx.org/home.php?mod=space&uid=1454093 alternative to viagra buy viagra viagra generic 100mg viagra without a doctor prescription
    generic viagra prices viagra without a doctor prescription 150 mg http://wx.jjj8.cn/zhubao/home.php?mod=space&uid=1423294 viagra without a doctor prescription online viagra generic viagra coupon female viagra

  13. MichaelZom
    MichaelZom
    回复

    how long for viagra to take effect india pharmacy viagra
    https://www.igrimace.com/bbs/home.php?mod=space&uid=4435954 real viagra without a doctor prescription
    what helps viagra work better cost of viagra per pill viagra problem

  14. Amitsflormror

    business credit score annual credit report official site intuit credit score get my credit score

  15. nqhydred
    nqhydred
    回复

    chumba casino
    twin river casino
    https://playcasinoslotsx.com - vegas world casino
    adele weight loss
    adele weight loss
    https://weight-loss-blogs.com - lose weight
    how to earn money online
    how to earn money
    https://make-money-blogs.com - how to make money fast

  16. smagmevagype
    smagmevagype
    回复

    free credit report experian http://checkcredithistorynx.com/ - what is credit score get free credit report my free credit report annual fico credit score

  17. JordanLex
    JordanLex
    回复

    viagra prices 100mg viagra without a doctor prescription http://niubi.gg/home.php?mod=space&uid=82153 viagra without a doctor prescription 150 mg 100 mg viagra lowest price viagra without a doctor prescription 150 mg generic viagra without subscription walmart
    viagra for sale real viagra without a doctor prescription https://ibbs.uu.cc/home.php?mod=space&uid=3310574 viagra prices female viagra subscription viagra without doctor prescription cialis vs viagra
    viagra cost real viagra without a doctor prescription http://23.225.178.244/home.php?mod=space&uid=2714833 viagra without a doctor prescription 150 mg viagra prescriptions over internet viagra without a doctor prescription 150 mg п»їviagra

  18. Barrygew
    Barrygew
    回复

    viagra on line generic viagra coupon
    http://www.jobs633.tech/home.php?mod=space&uid=711945 generic viagra
    viagra help viagra viagra online pharmacy

  19. Danielwat
    Danielwat
    回复

    natural viagra viagra generic
    http://us1.51php.com/discuzx/home.php?mod=space&uid=392091 viagrawithoutdoc viagra without a doctor prescription
    viagra prescriptions over internet cost of viagra per pill buy viagra online

  20. swimarumTauff

    check my credit score transunion free credit report average credit score

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