虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

发表新评论
已有 11027 条评论
  1. Yjdadns
    Yjdadns
    回复

    viagra professional first health insurance men's health the big book of foreplay

  2. hughdr3
    hughdr3
    回复

    Hot new pictures each day
    http://liveseks.nudeoldpic.bloglag.com/?juliettehot porn letters porn css feed for ipod lesbian enema nurses porn free victoria paris streaming porn porn public crucifixion

  3. AnnaDes
    AnnaDes
    回复

    buy sildenafil online india plaquenil drug combivent price in india generic viagra quick delivery non prescription medicine pharmacy

  4. JaneDes
    JaneDes
    回复

    cheap sildenafil 100mg

  5. fonfeent
    fonfeent
    回复

    Здравствуйте.
    Посоветуйте отличную типографию для заказа буклетов
    Могу посоветовать одну типографию , качество, цены и скорость у них отличное,
    но они размещаются в Красноярске, а мне хотелось бы в Новгороде.
    Вот печать блокнотов https://kraft-pt.ru/products/notepads

  6. SueDes
    SueDes
    回复

    synthroid 0.025 mg doxycycline buy online us propecia compare prices tadalafil 5 mg for sale without prescription doxycycline hyclate capsules hydroxychloroquine 200 mg cost trust pharmacy clomid 50mg tablets buy viagra online nz medicine plaquenil 200 mg

  7. JaneDes
    JaneDes
    回复

    azithromycin for sale

  8. AnnaDes
    AnnaDes
    回复

    soft levitra cialis soft gel augmentin xr 1000 mg prednisolone 1

  9. JimDes
    JimDes
    回复

    where to buy viagra over the counter in usa canadian pharmacy no prescription retin a 0.05 price tadalafil pills buy online z pack zithromax

  10. JtmfSkype
    JtmfSkype
    回复

    approved canadian online pharmacies texas state board of pharmacy legit online pharmacy

  11. EvaDes
    EvaDes
    回复

    synthroid 88 mcg tabs

  12. EvaDes
    EvaDes
    回复

    deltasone 20 mg tablet price

  13. Online Loan
    Online Loan
    回复

    holiday loans

  14. JimDes
    JimDes
    回复

    buy viagra online australia stromectol uk 500mg amoxicillin cost tadalafil daily online buy amoxicillin online 500 mg cheap phenergan pill where to buy viagra online safely

  15. Jahesedili
    Jahesedili
    回复

    lily icos cialis
    cialis 5mg daily joined
    cialis commercial - cialis pills online
    https://cialisboss.com/# - cialis 30 day sample
    cialis commercials avatar

  16. sporweevato
    sporweevato
    回复

    black cycling bib shorts women or best price cycling jersey ladieshttps://dspro.store/category/creative/

  17. ciaSa
    ciaSa
    回复

    cialis infarctus how to get ciails without a doctor us made cialis

  18. LisaDes
    LisaDes
    回复

    cheap propecia australia

  19. JoeDes
    JoeDes
    回复

    ventolin 200 mg cialis pharmacy online uk viagra 200mg pills amoxicillin 320 mg tretinoin 0.009 tadalafil soft gelatin capsules

  20. viagra tablets shops

    accutane online buy
    buy viagra via paypal
    ingredients cialis professional roani Cloup

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