虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

发表新评论
已有 2795 条评论
  1. JordanLex
    JordanLex
    回复

    cheapest cialis taking l-citrulline and cialis together
    liquid cialis

  2. crapyragacoup

    check credit score http://creditcheckweb.com/ - experian free credit score free online credit report my credit score free

  3. swimarumTauff

    credit karma check my credit score http://creditcheckmax.com/ - credit score online how to dispute credit report credit reports free credit score equifax

  4. adfrubleme
    adfrubleme
    回复

    avastsvc.exe avast antivirus service instup.exe avast antivirus installer https://xantivirusx.com/ - segurazo antivirus ourtime dating site who is blake shelton dating https://onlinedatingwow.com/ - xname lname dating diy network sweepstakes bhg sweepstakes https://supersweepstakesx.com/ - online sweepstakes

  5. KevinCub
    KevinCub
    回复

    what is cialis cialis vidalista
    http://tadalafilprof.com side effects of cialis

  6. smagmevagype
    smagmevagype
    回复

    credit report definition free annual credit report official site free annual credit report complaints check credit rating

  7. Amitsflormror

    get credit report credit karma uk credit karma tax filing perfect credit score http://checkcreditps.com/ - free yearly credit report

  8. MarcusCop
    MarcusCop
    回复

    cialis tolerance warnings for cialis
    http://tadalafilprof.com cialis lowest price
    cialis side effects cialis prices 20mg real cialis without a doctor's prescription

  9. Frankstync
    Frankstync
    回复

    viagra sale cebu
    http://tadalafilprof.com generic for cialis

  10. JordanLex
    JordanLex
    回复

    daily use of cialis cialis prices
    buy cialis online

  11. swimarumTauff

    how to check your credit score credit report free how to read credit report

  12. crapyragacoup

    http://creditcheckweb.com/ how to raise your credit score fast what is an excellent credit score discover credit score credit scoring

  13. gfbmured
    gfbmured
    回复

    Vladimir Safronov, urologist.Lyrics.Missed Dose.Delete Comment.This chemical relaxes certain muscle cells in the erectile tissue of the penis, allowing blood-flow to increase to that area. viagra online Itsoktocry X Austin Skinner Dreamland Destiny Slowed Reverb.While they still wish to be more aroused, they also want a pill that stimulates their desire to make love, says the specialist.51 MB 00 02 40 150.Talk to your doctor if you develop any reactions that you consider to be serious or abnormal, as you may need an adjustment of your Female Viagra dose.There have also been cases requiring urgent surgery, particularly in patients with priapism. generic viagra The most common of them are.Do Viagra like medicines have side effects.I d been a dancer when I was young, but I had never been involved in athletics in any other way.Fast food and packaging come together.Furthermore, nitrogen oxide relaxes the smooth muscles of the corpora cavernosa of the penis, favoring the blood filling that causes an erection. https://pharm-usa-official.com - viagra pills Of all listed here, Cialis users have only been reported suffering from the latter three and there were so few of them that the risk is considered to be negligible.If you re having sex less frequently, you might find that taking Viagra as needed is convenient.Check to see if you can take erectile dysfunction pills.he s not in mucins room and you re not in yours, brilliant pratt, uses of vega viagra with a forty-ninth corporality.Noe and before and after was fond of scenes hardcore moments can be found in almost every film, from the full-length debut Of One against all and ending with shorts of different years, and in the entrance to the void he was sophisticated and did show sexual intercourse from within, however, it was already photorealistic computer animation.

  14. KevinCub
    KevinCub
    回复

    nose congested when taking cialis otc cialis
    http://tadalafilprof.com liquid cialis source reviews

  15. Belousovaobete

    cheap cialiscialis onlineviagra onlineviagracialis onlinecialis onlinecheap cialiscialis onlinecialiscialis online

  16. smagmevagype
    smagmevagype
    回复

    how to increase your credit score fast http://checkcredithistorynx.com/ - experian free credit report boost my credit score free credit reports

  17. Amitsflormror

    credit score check http://checkcreditps.com/ free credit check report credit score range free credit report transunion

  18. KevinCub
    KevinCub
    回复

    coupons for cialis what is cialis used for
    http://tadalafilprof.com lowest cialis prices

  19. MarcusCop
    MarcusCop
    回复

    when will cialis go generic cialis price
    http://tadalafilprof.com when will cialis go generic
    low cost cialis price of cialis the effects of cialis on women

  20. Frankstync
    Frankstync
    回复

    cialis professional for sale
    http://tadalafilprof.com prices of cialis

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