虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

发表新评论
已有 4657 条评论
  1. JaneDes
    JaneDes
    回复

    paxil price without insurance

  2. Kennethdem
    Kennethdem
    回复

    generic cialis black 800mg cialis online
    https://cialisfavdrug.com/# expired cialis 3 years
    cialis coupons 2019 cialis generic warnings for cialis

  3. NickDes
    NickDes
    回复

    tetracycline online purchase need prescription for viagra

  4. SueDes
    SueDes
    回复

    plaquenil 600 mg can you buy phenergan over the counter wellbutrin 30 mg purchase ciprofloxin cheap generic viagra canadian pharmacy viagra usa pharmacy buy plaquenil 10mg fluoxetine 20 mg tablet brand name aralen phosphate chloroquine phosphate voltaren gel india price

  5. Kennethdem
    Kennethdem
    回复

    expired cialis 3 years cialis generic
    https://cialisfavdrug.com/# 30ml liquid cialis
    buy cialis generic tadalafil cialis without a doctor prescription

  6. SueDes
    SueDes
    回复

    online cymbalta chloroquine new zealand buy hydroxychloroquine sulfate cipro 2017 how much is generic viagra in canada tadacip for sale inderal 40 price plaquenil malaria canadian pharmacy sildenafil cheap plaquenil

  7. EvaDes
    EvaDes
    回复

    generic for plavix

  8. Kennethdem
    Kennethdem
    回复

    cialis tolerance generic cialis
    https://cialisfavdrug.com/# free cialis
    can you have multiple orgasms with cialis generic cialis cialis and interaction with ibutinib

  9. KiaDes
    KiaDes
    回复

    seroquel for depression

  10. JoeDes
    JoeDes
    回复

    dapoxetine 30 mg tablet price in india atarax for sleep tadalafil gel cost of nexium rx augmentin 875 mg 125 mg tablet price

  11. SueDes
    SueDes
    回复

    20g amitriptyline viagra for sale in india cheap viagra online free shipping cost of seroquel 300 mg generic tadalafil united states inderal 80 mg order suhagra 100 cheap baclofen uk viagra canada discount viagra price in india

  12. Wilsonlag
    Wilsonlag
    回复

    the cost of cialis cialis tadalafil 20 mg
    https://cialisfavdrug.com/# - generic cialis bitcoin
    cialis erection penis generic cialis - safe alternatives to viagra and cialis

  13. Kennethdem
    Kennethdem
    回复

    cialis prices 20mg cialis coupon
    https://cialisfavdrug.com/# generic cialis black 800mg
    current cost of cialis 5mg cvs buy generic cialis cialis 200mg

  14. HowardPem
    HowardPem
    回复

    real cialis without a doctor prescription: buy cialis online
    cialisfavdrug.com - does cialis make you bigger

  15. MiaDes
    MiaDes
    回复

    extra super avana brand name cialis online biaxin xl 500 viagra usa 100mg buy brand name cialis online

  16. SueDes
    SueDes
    回复

    clindamycin 500 mg tablets generic proscar citalopram hbr 20 mg for anxiety buy vermox over the counter metformin hcl 500 mg without prescription buy albendazole 400 mg uk aralen price usa price of ivermectin liquid generic priligy hydroxychloroquine sulfate tablet

  17. Davidsog
    Davidsog
    回复

    purchasing cialis on the internet buy generic cialis
    https://cialisfavdrug.com/# - cialis coupons printable

  18. Kennethdem
    Kennethdem
    回复

    prices of cialis order cialis
    https://cialisfavdrug.com/# is cialis generic available
    expired cialis 3 years generic cialis available cialis for daily use

  19. AnnaDes
    AnnaDes
    回复

    can i buy ciprofloxacin over the counter usa albenza 200mg aralen over the counter can you buy stromectol over the counter biaxin filmtabs

  20. DenDes
    DenDes
    回复

    digoxin 0.125mg cost medrol 8 mg tablet buy amoxicillin 500mg capsules uk genuine viagra plaquenil hair loss

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