虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

发表新评论
已有 4653 条评论
  1. MiaDes
    MiaDes
    回复

    propranolol beta blocker 20 amoxicillin 500mg cost plaquenil arthritis where can you buy antabuse best generic sildenafil

  2. Kennethdem
    Kennethdem
    回复

    online cialis buy generic cialis
    https://cialisfavdrug.com/# is generic cialis safe
    cialis discount card cialis coupon how to take cialis

  3. JimDes
    JimDes
    回复

    tenormin 100 mg tablets how to get cipro buspar 30 mg pill cymbalta generic zoloft australia cost of fluoxetine uk ivermectin 3mg

  4. JaneDes
    JaneDes
    回复

    flagyl 400 mg

  5. JasonDes
    JasonDes
    回复

    where to buy tadalafil on line plaquenil 5 mg generic viagra prices buy viagra free shipping hydroxychloroquine 700 mg chloroquine prophylaxis tadalafil india levitra buy without a prescription how can i get generic viagra in canada buy priligy online pharmacy

  6. JimDes
    JimDes
    回复

    malegra for sale buy viagra online india 100mg zofran online uk

  7. KimDes
    KimDes
    回复

    furosemide 20 mg tablet

  8. AmyDes
    AmyDes
    回复

    cialis tablets for sale

  9. SamDes
    SamDes
    回复

    citalopram 20 mg cost sildenafil price mexico hydroxychloroquine name brand tenormin 50 mg price trazodone tablets

  10. MiaDes
    MiaDes
    回复

    desyrel 100 mg tab buy valtrex online prazosin coupon flagyl 500 mg anafranil uk

  11. Kennethdem
    Kennethdem
    回复

    cost of cialis order cialis
    https://cialisfavdrug.com/# cialis without a doctor prescription
    where to bay cialis (tadalafil) pills 80mg tadalafil real cialis without a doctor's prescription

  12. JoeDes
    JoeDes
    回复

    cephalexin 500mg prescription medication atarax 40 mg lasix buy cafergot usa over the counter generic sildenafil cialis 60 quineprox 400

  13. MiaDes
    MiaDes
    回复

    viagra buy uk online hydroxychloroquine 200mg 60 tablets lasix 115 sildenafil no rx paroxetine 20 mg tablet

  14. Kennethdem
    Kennethdem
    回复

    does medicaid cover cialis buy generic cialis
    https://cialisfavdrug.com/# does cialis lower your blood pressure
    cialis 20 mg generic cialis at walgreens pharmacy cialis coupon code

  15. AnnaDes
    AnnaDes
    回复

    sildenafil 50 mg generic cialis brand price zanaflex 2mg tablets plavix 75 mg pill prazosin 0.5 mg zoloft online buy

  16. Ltqs30l
    Ltqs30l
    回复

    cialis time work https://www.cialiswlmrt.com/# - cialis over the counter levitra cialis viagra better

  17. Lqcf39o
    Lqcf39o
    回复

    generic viagra 100mg viagra without a doctor prescription https://withoutdct.com/# viagra without a doctor prescription wo kann man viagra online kaufen

  18. LisaDes
    LisaDes
    回复

    over the counter baclofen

  19. HowardPem
    HowardPem
    回复

    take cialis with or without food: generic tadalafil
    cialisfavdrug.com - generic for cialis

  20. SueDes
    SueDes
    回复

    chloroquine 100 mg 5mg viagra tadalafil 10mg tablets in india kamagra oral jelly online pharmacy best price for plaquenil chloroquine hcl purchase amitriptyline can i buy amoxicillin over the counter in uk how to safely order viagra online antabuse australia price

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