虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

发表新评论
已有 26171 条评论
  1. EvaDes
    EvaDes
    回复

    tadalafil uk online

  2. Spotloan
    Spotloan
    回复

    payday loans direct lender payday loans no teletrack check payday loan rates 500 payday loan 1000 loan accredited debt relief

  3. JaneDes
    JaneDes
    回复

    generic cialis daily canada

  4. JaneDes
    JaneDes
    回复

    prednisolone 5mg prices

  5. prednSa
    prednSa
    回复

    prednisone bfp [url=https://prednisonetf.com/]order prednisone online[/url] prednisone heart pain

  6. getSa
    getSa
    回复

    amoxicillin erythromycin combination is amoxil antibiotic safe during pregnancy pediatric amoxicillin dose for ear infection

  7. JackDes
    JackDes
    回复

    chloroquine 20 vardenafil for sale 20 mg plaquenil hives quineprox 900 synthroid 50 mcg cost albuterol medication pills

  8. SamDes
    SamDes
    回复

    lexapro.com vardenafil tablets 20 mg in india propecia cost australia

  9. lasSa
    lasSa
    回复

    dose of lasix in congestive heart failure [url=https://lasixmg500.com/]lasix 40 mg price in india[/url] lasix cirrhosis liver

  10. JasonDes
    JasonDes
    回复

    cialis medicine online doxycycline 100mg over the counter generic clomid generic for ventolin can i buy propecia online 40 mg levitra zithromax over the counter usa foreign online pharmacy can you buy cialis over the counter uk doxycycline 100mg tablet

  11. getSa
    getSa
    回复

    can u drink alcohol taking amoxicillin buy amoxil online australia bladder infection treatment amoxicillin

  12. Bad Credit
    Bad Credit
    回复

    fast cash payday loan bad credit payday loan payday today no fuss payday loans cash express loans personal loans for poor credit payday loans calgary payday loan in las vegas money lenders loans in arizona

  13. IvyDes
    IvyDes
    回复

    prednisolone 3 mg lexapro 5mg tablet cost cheap canadian pharmacy cialis prednisone corticosteroids female viagra pills online plaquenil tablets viagra 100mg online uk can you buy azithromycin plaquenil 400mg cheap generic viagra online canada clomid pills cialis europe buy cialis 5mg online canada tretinoin 0.1 cream 45mg how to get amoxicillin over the counter uk

  14. SamDes
    SamDes
    回复

    online pharmacy no prescription zithromax buy cheap where to buy albuterol levitra 2.5 mg

  15. JoeDes
    JoeDes
    回复

    doxycycline 40 mg india generic propecia prescription online levitra in canada levitra tablet price in india

  16. JoeDes
    JoeDes
    回复

    ivermectin 9 mg hydroxychloroquine 500 mg viagra 50mg tablet where to buy retin-a synthroid 37 5 mcg online pharmacy vardenafil chloroquine phosphate generic

  17. LisaDes
    LisaDes
    回复

    chloroquine tablets australia

  18. MiaDes
    MiaDes
    回复

    doxycycline prescription online ventolin online no prescription buy levitra online canadian pharmacy cialis prescription online doxycycline pills over the counter

  19. AmyDes
    AmyDes
    回复

    hydroxychloroquine sulfate 300 mg

  20. FgnhAstew
    FgnhAstew
    回复

    generic vs brand name viagra viagra • cialis • buy good cheap viagra is viagra over the counter sign up viagra viagra prices walgreens viagra on sale online viagra for sale online where to buy viagra with discover card cheap viagra in us order viagra online from canada cheap viagra express shipping viagra dosage standard where can i buy viagra in exeter ggeneric viagra for sale

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