虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

发表新评论
已有 26176 条评论
  1. demedvgrnualf

    viagra in polen frauen viagra bestellen olivenöl besser als viagra
    wie viel kostet viagra?

  2. cookingpost
    cookingpost
    回复

    Кулинария
    Кулинария
    пошаговые рецепты
    рецепты вкусных салатов
    рецепты вкусных салатовcookingwrw31
    домашние рецепты
    рецепты салатов
    супы рецепты
    рецепт теста
    рецепты вкусных салатов

  3. best canadian online pharmacies

    top rated canadian online pharmacy
    http://canadiannextpharmacy.com/
    canadian pharmacy reviews

  4. JoeDes
    JoeDes
    回复

    real viagra price diflucan cream otc tetracycline 250 mg cap lasix to buy how much does viagra cost generic for yasmin birth control

  5. JoeDes
    JoeDes
    回复

    propecia generic canada costs of tetracycline tadalafil 20mg lowest price female viagra cream where can i buy cialis in australia tretinoin 0.5 cream online clomid 50mg cost

  6. reliable canadian pharmacy

    safe online pharmacies
    http://canadiannextpharmacy.com/
    overseas online pharmacies

  7. demedvgrnualf

    lady era viagra preisvergleich viagra generika 100mg viagra kaufen deutschland ohne rezept
    wie kann man viagra verschrieben bekommen

  8. cialifS
    cialifS
    回复

    buy cialis rush cialis ver bula

  9. IvyDes
    IvyDes
    回复

    buy cialis 100mg online canada cialis otc tetracycline prescription lexapro online india acyclovir tablets over the counter cymbalta over the counter can i buy indocin good value pharmacy buy yasmin online canada metformin 850 mg price in india retin a cream buy online buy online 10mg prednisolone wellbutrin price canada arimidex for bodybuilding 50 mg seroquel

  10. JaneDes
    JaneDes
    回复

    diflucan capsule price

  11. best online canadian pharmacy

    list of legitimate canadian pharmacies
    http://canadianpharmaciesdepot.com/
    canadian online pharmacy reviews

  12. JamesEsorn
    JamesEsorn
    回复

    generic viagra without a doctor prescription meds without a doctor prescription
    muse ed drug http://genericvgrshop.com viagra Without a Doctor Prescription
    meds without a doctor prescription viagra only 0.2$

  13. KimDes
    KimDes
    回复

    bupropion europe

  14. JdbxSkype
    JdbxSkype
    回复

    buy viagra in uk online where can i get viagra shipped overnight order generic viagra online http://llviabest.com/ - redtube viagra sale ’

  15. demedvgrnualf

    pfizer viagra viagra günstig kaufen per überweisung viagra und koks zusammen
    was ist wenn eine frau viagra nimmt

  16. cializS
    cializS
    回复

    monthly cost of cialis without insurance cialis 70 mg

  17. JamesEsorn
    JamesEsorn
    回复

    prescription viagra online without doctor buying prescription viagra from canada
    prescription drugs online without http://genericvgrshop.com buying prescription viagra from canada
    buy viagra very cheap viagra

  18. cializS
    cializS
    回复

    [url=https://5cialismg.com/]how to buy cialis online uk[/url] cialis original contrareembolso

  19. Jefferydycle
    Jefferydycle
    回复

    The Vogue Choice where we share your passion. That’s why we have gathered a remarkable collection of fashion products in such categories as sunglasses and Fashion Products
    to name a few. You will not regret the decision to buy from this online shop thanks to a rich selection of goods, affordable prices and outstanding customer service.

  20. cializS
    cializS
    回复

    how much does cialis cost with insurance champix cialis

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