虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

发表新评论
已有 5739 条评论
  1. https://aaaviag.com/

    viagra price in england
    free female viagra
    historic price viagra roani Cloup

  2. Jamesdarly
    Jamesdarly
    回复

    viagra achat en france cialis 20mg prix en pharmacie sildenafil 50 mg sans ordonnance
    pharmacie en ligne http://pharmfrancaise.fr viagra sans ordonnance en pharmacie
    viagra generique livre sous 48h viagra ou trouver viagra sans ordonnance

  3. https://aaaviag.com/

    buying safe viagra
    real viagra india
    buy canada levitra roani Cloup

  4. Money Loan
    Money Loan
    回复

    payday loan usa

  5. Emanuelmip
    Emanuelmip
    回复

    viagra in farmacia senza ricetta viagra prezzo farmacia vendita viagra in italia
    acquisto viagra online sicuro http://silditaliana.it vendita viagra in italia
    viagra prezzo in farmacia prezzo viagra 100 mg viagra prezzo farmacia

  6. cialis
    cialis
    回复

    Non-specific Information Here this offshoot
    cialis https://cialislevel.com/# cialis

  7. canadian pharmacy

    Global Dope Far this by-product
    canadian pharmacy https://canadianpharmacysts.com/# canadian pharmacy

  8. levitra
    levitra
    回复

    Accustomed Dope Fro this product
    levitra: https://levitrahill.com/# levitra

  9. DurekFaw
    DurekFaw
    回复

    You said it very well.! how to write an essay for college homework help cpm university microfilms dissertations

  10. PaulDes
    PaulDes
    回复

    tadalafil online rx purchase sildenafil 20 mg generic tadalafil without prescription online sildenafil without prescription viagra tabs

  11. JaneDes
    JaneDes
    回复

    sildenafil canada

  12. Jamesdarly
    Jamesdarly
    回复

    viagra generique livre sous 48h cialis 20mg prix en pharmacie viagra sans ordonnance livraison rapide
    viagra sans ordonnance http://pharmfrancaise.fr viagra generique livre sous 48h
    viagra prix en pharmacie france viagra prix en pharmacie france pharmacie en ligne

  13. JimDes
    JimDes
    回复

    dipyridamole capsules tadalafil 2.5 mg cost anafranil generic cost tadalafil 5 mg tablet coupon buy cialis singapore vgel price

  14. aarp recommended canadian pharmacies

    pharmacy online
    http://canadianpharmacynethd.com/
    overseas pharmacies

  15. NickDes
    NickDes
    回复

    allopurinol cost canada tadalafil cost australia differin 0.1 cream entocort 3

  16. canadian drugs

    Fantastic content, Cheers.

  17. dissertation writing

    Really a good deal of wonderful data. essay about reading and writing https://homeworkcourseworkhelps.com writing services reviews

  18. canadian pharmacy

    best online pharmacies
    http://canadianpharmacynethd.com/
    safe canadian pharmacies online

  19. AmyDes
    AmyDes
    回复

    toprol coupon

  20. BrenoSuess
    BrenoSuess
    回复

    Kudos! I value it!
    where can i pay someone to write my essay best essay writing services professional writer services

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