虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

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

    finasteride 1mg no prescription azithromycin 1000mg buy tretinoin cream australia levitra 60 mg price levitra otc

  2. KimDes
    KimDes
    回复

    where to buy retin a in canada

  3. Empdhp
    Empdhp
    回复

    vardenafil 10 mg http://levitrosx.com/ cheapest ed pills Dvffob bfpjzq

  4. lasSa
    lasSa
    回复

    is it safe to take lasix while pregnant buy lasix cheap online lasix 20 mg pill

  5. getSa
    getSa
    回复

    is amoxicillin safe in pregnancy price of amoxil augmentin amoxicillin clavulanate side effects

  6. prednSa
    prednSa
    回复

    medrol dose pack and prednisone equivalent cheap generic prednisone how long does water retention last after prednisone

  7. SueDes
    SueDes
    回复

    plaquenil 0 2g lexapro 10 mg order levitra generic sildenafil drug plaquenil canada generic zithromax 500mg vardenafil generic doxycycline 150 mg cost cialis online purchase in india buy cheap viagra

  8. prednSa
    prednSa
    回复

    m?dicament prednisone arrow [url=https://prednisonetf.com/]buy prednisone india[/url] prednisone used for rash

  9. prednSa
    prednSa
    回复

    prednisone 20 mg 3 times daily prednisone 20mg for sale modified-release prednisone tablets

  10. NickDes
    NickDes
    回复

    cialis purchase india doxycycline mexico synthroid 50 doxycycline hyclate 100 mg capsules azithromycin 1g cost trimox cheap plaquenil for sarcoidosis rx pharmacy online tadalafil

  11. Klionorp
    Klionorp
    回复

    what if viagra doesnt work another tablet viagra free sample young people viagra viagra online buy paypal viagra no prescription how can i get free viagra generic viagra testimonials super viagra online viagra canada paypal viagra prices walgreens viagra on line singapore buying viagra in canada viagra 100mg viagra 4 pack watch viagra at work

  12. getSa
    getSa
    回复

    how long should i take amoxicillin for tooth infection [url=https://amoxilxl.com/]generic of amoxil[/url] amoxicillin ya and you

  13. getSa
    getSa
    回复

    amoxicillin ibuprofen can you mix where can i buy amoxil online amoxicillin and bayer aspirin

  14. NickDes
    NickDes
    回复

    tadalafil cialis buy generic viagra 50mg vardenafil online no prescription cialis 50 buy generic cialis online safely purchase viagra online viagra 200mg online

  15. MiaDes
    MiaDes
    回复

    retin a moisturizer cialis 20mg lowest price ivermectin over the counter canada online viagra from india clomid 50mg tablets buy

  16. prednSa
    prednSa
    回复

    prednisone 5 ml buy prednisone 5 mg uc prednisone dosage

  17. SueDes
    SueDes
    回复

    prednisolone 4 mg tablets brand amoxil canadien pharmacies cialis 10mg purchase purchase cialis 10mg prednisolone sod lexapro pills for sale phenergan 25mg price buy lyrica 150 mg best online propecia

  18. JimDes
    JimDes
    回复

    azithromycin 250 mg tablet price cialis for sale mexico levitra cost in india lexapro purchase online vardenafil best price how to buy viagra in india

  19. prix d une boite de viagra en pharmacie

    nitrofurantoin online uk
    brand viagra online us pharmacy
    discount viagra or cialis which is stronger roani Cloup

  20. getSa
    getSa
    回复

    is amoxicillin 875 the same as augmentin [url=https://amoxilxl.com/]buy amoxil online cheap[/url] amoxicillin or doxycycline for lyme

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