虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

发表新评论
已有 11024 条评论
  1. beFugsassurb
    beFugsassurb
    回复

    https://cialinic.com/ - generic tadalafil

  2. JoeDes
    JoeDes
    回复

    where to buy ivermectin pills buy tretinoin cream female viagra pills price

  3. EvaDes
    EvaDes
    回复

    lyrica australia

  4. Opeh16p
    Opeh16p
    回复

    http://doctorborat.com/ can you build tolerance to viagra viagra no doctor prescription online cpr training

  5. Clydegaf
    Clydegaf
    回复

    ddl.me

  6. IvyDes
    IvyDes
    回复

    plaquenil price australia lyrica without rx tadalafil canadian pharmacy sildenafil online singapore purchase synthroid online aralen 500mg viagra usa buy hydroxychloroquine sulfate australia tretinoin cream 0.1 buy online generic propecia online cheap cialis 5 mg online best online pet pharmacy sildenafil 100 cheap viagra online pharmacy order doxycycline capsules online

  7. Best Payday Loan

    payday loans near me no credit check

  8. JackDes
    JackDes
    回复

    cialis tadalafil 20mg prednisone buy canada how much is prednisolone cost prices for tretinoin cream purchase cialis in mexico lexapro 2.5 mg can you buy ventolin over the counter in usa tretinoin cream .05

  9. ciaSa
    ciaSa
    回复

    cialis honeymoon buy cialis with paypal cialis 5mg price in india

  10. NickDes
    NickDes
    回复

    plaquenil cost doxycycline price australia prednisolone for sale in uk doxycycline uk pharmacy generic cialis 30 mg quineprox kratom chloroquine

  11. MaryDes
    MaryDes
    回复

    generic cialis without a prescription cialis non prescription viagra online purchase in usa lyrica drug buy cialis in usa compare levitra prices finasteride buy online cheap viagra 100mg tablets tadalafil 20mg price comparison prescription prednisone cream

  12. EvaDes
    EvaDes
    回复

    levitra canadian online pharmacy

  13. SamDes
    SamDes
    回复

    retin a 0.05 coupon cialis generic no prescription online levitra in canada buy amoxicillin online

  14. Chaseexivy
    Chaseexivy
    回复

    XYZ 壯陽藥春藥專賣店 大量購買有優惠https://man-r20.com/

  15. ciaSa
    ciaSa
    回复

    cortar cialis [url=https://cialistf.com/]buy cialis online overnight[/url] cialis craigslist vancouver

  16. ciaSa
    ciaSa
    回复

    cialis pub vancouver buy cialis philippines which is better levitra vs cialis

  17. JaneDes
    JaneDes
    回复

    best female viagra tablets in india

  18. IvyDes
    IvyDes
    回复

    levitra lowest prices average cost for doxycycline pharmacy online 365 discount code where can i get viagra in australia where can i buy amoxicillin over the counter pharmacy wholesalers canada buy doxycycline online without a prescription ivermectin 3mg tablets how to buy cialis in usa prednisone 20mg buy online lexapro 50 mg price propecia in india viagra 1 tablet price cialis india cheap lexapro coupon 20 mg

  19. buy doxazosin online

    viagra kaufen cialis
    buying viagra in canada
    generic cialis in south africa roani Cloup

  20. JimDes
    JimDes
    回复

    aralen price generic levitra in us canada otc albuterol

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