虫言虫语 虫言虫语

本地自签证书测试https

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

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

    http://checkcreditps.com/ credit report agencies freecreditreport credit score definition government free credit report

  2. MichaelZom
    MichaelZom
    回复

    how does viagra work generic viagra
    http://vgrmall.com/# viagra without a doctor prescription
    п»їviagra viagra pills female viagra

  3. smagmevagype
    smagmevagype
    回复

    what is a good credit score http://checkcredithistorynx.com/ - what credit score for mortgage what is considered a good credit score how to increase your credit score fast free online credit report

  4. Danielwat
    Danielwat
    回复

    otc viagra real viagra without a doctor prescription
    http://vgrmall.com/# 100mg viagra without a doctor prescription
    viagra without doctor prescription viagrawithoutdoc viagra without a doctor prescription levitra vs viagra

  5. swimarumTauff

    http://creditcheckmax.com/ get a free credit report how to raise your credit score fast transunion credit score intuit credit score

  6. jrnlableme
    jrnlableme
    回复

    cialis generic
    canadian pharmacy cialis
    https://paydailoanz.com/cialis.php - buy cialis
    tadalafil cost
    generic tadalafil
    https://paydailoanz.com/tadalafil.php - liquid tadalafil
    online levitra
    levitra 20mg
    https://paydailoanz.com/levitra.php - levitra 20mg
    levitra 20mg
    levitra 20mg
    https://cbdoilnumber1.com/levitra/ - levitra pills
    cialis generic
    cheap cialis
    https://cbdoilnumber1.com/cialis/ - cialis buy online

  7. crapyragacoup

    perfect credit score http://creditcheckweb.com/ free annual credit report official site free credit score equifax credit score check

  8. EyeDes
    EyeDes
    回复

    pink viagra duloxetine cymbalta tadalafil 20 how to buy accutane cialis generic toradol tabs indocin buy ampicillin uk amoxicillin 650 mg price synthroid buy online propecia prescription usa cheap advair diskus prozac 20 mg kamagra online pharmacy india trazodone generic pill baclofen 10 mg price tadalafil 5mg coupon buy diclofenac anafranil 50 mg buy ventolin online no prescription

  9. JordanLex
    JordanLex
    回复

    what is viagra generic viagra http://vgrmall.com/# viagra prescriptions over internet canadian pharmacy viagra best generic viagra websites when will generic viagra be available

  10. Barrygew
    Barrygew
    回复

    how does viagra work cost of viagra per pill
    http://vgrmall.com/# 100mg viagra without a doctor prescription
    herbal viagra viagra prescription cost of viagra 100mg

  11. MichaelZom
    MichaelZom
    回复

    ed pills that work better than viagra viagra generic
    http://vgrmall.com/# alternative to viagra
    100mg viagra without a doctor prescription alternative to viagra female viagra pills

  12. Amitsflormror

    credit score rating http://checkcreditps.com/ get credit score average credit score what is credit score

  13. smagmevagype
    smagmevagype
    回复

    http://checkcredithistorynx.com/ annual free credit report official site discover credit score credit report scores credit karma com free credit score

  14. Danielwat
    Danielwat
    回复

    ed pills that work better than viagra genuine viagra without a doctor prescription
    http://vgrmall.com/# viagra dosage recommendations
    real viagra without a doctor prescription viagrawithoutdoc viagra without a doctor prescription 100 mg viagra lowest price

  15. Alfeiobete
    Alfeiobete
    回复

    cheap cialiscialis onlinebuy viagracheap viagraviagrabuy viagraviagra onlinecheap viagracheap cialischeap cialis

  16. swimarumTauff

    how to dispute credit report items http://creditcheckmax.com/ credit report companies annual free credit report credit report scores

  17. lahuidach
    lahuidach
    回复

    payday loans online bad credit [url=https://www.paydayloansintheusa.com/PA#]payday loans Pennsylvania[/url]
    payday loans without checking account requirements
    https://www.paydayloansintheusa.com/PA

  18. lahuidach
    lahuidach
    回复

    payday loans for bad credit payday loans in DE
    payday loans near me open now
    https://www.paydayloansintheusa.com/DE

  19. Barrygew
    Barrygew
    回复

    generic viagra available in usa real viagra without a doctor prescription
    http://vgrmall.com/# viagra without a doctor prescription
    women viagra viagra viagra in action

  20. crapyragacoup

    free credit score check what is a good credit score number good credit score range credit score simulator

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