虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

发表新评论
已有 26179 条评论
  1. rachaelxb3
    rachaelxb3
    回复

    Bgi Ass Photos - Free Huge Butt Porn, Big Booty Pics
    http://shemalle.webcamshemale.alexysexy.com/?taniaporn gay redhead lil cunts porn amature submitted porn videos porn movie about christmas jasmine lynn porn

  2. drugstore of canada lblvqh

    viagra women canadian rx prices cialis generic canada
    5 mg cialis canada canadian pharmaceuticals

  3. overseas pharmacy

    my canadian pharmacy
    http://canadianpharmaciesdepot.com/
    safe online pharmacies

  4. KimDes
    KimDes
    回复

    where can i buy cialis online in canada

  5. JoeDes
    JoeDes
    回复

    generic atarax indocin prescription seroquel tablets buy

  6. is there a generic cialis gfddie

    buy viagra online cheap buy viagra without a prescription viagra tablets
    cialis without prescription canada sample viagra

  7. cializS
    cializS
    回复

    cialis online without prescription venda cialis receita

  8. dramamine 50mg for sale

    rogaine 5% united kingdom cheapest rogaine rogaine purchase

  9. AnnaDes
    AnnaDes
    回复

    online pharmacy without prescription viagra capsule online how to get propecia nz furosemide 20 mg tablet order viagra online nz terramycin for humans dapoxetine 30mg 1mg cialis singapore

  10. JaneDes
    JaneDes
    回复

    canadian pharmacy cialis 20mg

  11. JoeDes
    JoeDes
    回复

    citalopram hydrobromide 40mg tab cheap generic viagra uk tetracycline prednisone 20mg tablets price zovirax canada order lasix without a prescription

  12. JamesEsorn
    JamesEsorn
    回复

    buy generic viagra here viagra only 0.2$
    online medications http://genericvgrshop.com generic viagra for ed
    viagra Without a Doctor Prescription buy cheap prescription viagra online

  13. Ppwnlu
    Ppwnlu
    回复

    live casino slots online http://slotsgamb.com/ casino online slots Ynuhma bivrwp

  14. MiaDes
    MiaDes
    回复

    hydrochlorothiazide capsule azithromycin 250 mg suppliers tetracycline buy online good value pharmacy where to buy plaquenil

  15. MiaDes
    MiaDes
    回复

    40 mg levitra metformin canada price celexa 40 mg cost phenergan 2 where to buy finasteride

  16. Payday
    Payday
    回复

    loans login cashloans

  17. safe canadian pharmacies online

    best canadian mail order pharmacies
    http://canadiannextpharmacy.com/
    legitimate canadian pharmacy online

  18. cializS
    cializS
    回复

    [url=https://5cialismg.com/]buy cialis 36 hour[/url] levitra viagra cialis differences

  19. JamesEsorn
    JamesEsorn
    回复

    viagra Without a Doctor Prescription prescription viagra online without doctor
    comparison of ed drugs http://genericvgrshop.com generic viagra for sale
    generic viagra for sale generic viagra for ed

  20. cialifS
    cialifS
    回复

    buy cialis doctor which drug is better cialis or viagra

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