虫言虫语 虫言虫语

本地自签证书测试https

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

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

支付宝打赏

文章二维码

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

发表新评论
已有 18426 条评论
  1. JoeDes
    JoeDes
    回复

    buy cialis in uk retin a 0.04 zithromax 250 mg cost tadalafil 2.5 mg in india vardenafil 40 mg india

  2. JimDes
    JimDes
    回复

    buy lexapro no prescription cialis cost uk

  3. JoeDes
    JoeDes
    回复

    lexapro 100 mg doxycycline 100mg cost in india lipitor generic on line no prescription prednisolone 15 prednisolone 25mg

  4. buy amoxil
    buy amoxil
    回复

    best seller cialis
    buy viagrawith echeck or ach
    cheap tadalafil in quanity roani Cloup

  5. tadalafil on line pharmacie

    buy cialis without prescriptions
    generic viagra overnight
    cialis generic aus deutschland roani Cloup

  6. beFugsassurb
    beFugsassurb
    回复

    https://cialistodo.com/ - buying cialis online safe

  7. KimDes
    KimDes
    回复

    price of viagra in us

  8. JoeDes
    JoeDes
    回复

    canadian pharmacy propecia buy levitra online in usa doxycycline brand name azithromycin 500 mg tabs

  9. imodium tablet

    vantin cheap vantin without prescription vantin coupon

  10. KiaDes
    KiaDes
    回复

    retin a gel price in india

  11. Pay Day Loans

    loan with bad credit

  12. Iqtxvz
    Iqtxvz
    回复

    home remedies for erectile dysfunction http://edpropls.com/ best ed drug Iqoyts bswxvb

  13. JaneDes
    JaneDes
    回复

    buy amoxil online australia

  14. Iprw69v
    Iprw69v
    回复

    free viagra samples online united health medical insurance viagra cost vs cialis cost

  15. JaneDes
    JaneDes
    回复

    buy synthroid cheap

  16. NickDes
    NickDes
    回复

    where to buy phenergan online quineprox 40 zithromax australia viagra 20 buy prednisone online cheap plaquenil hydroxychloroquine levitra fast delivery where can i buy viagra without a prescription

  17. viagra costs pill

    viagra substitute that can be bought over the counter
    viagra in women
    cheap kamagra generic viagra uk roani Cloup

  18. EvaDes
    EvaDes
    回复

    retin a 1 cream mexico

  19. SamDes
    SamDes
    回复

    hydroxychloroquine 300 mg amoxicillin 800 mg buy phenergan nz cheapest plaquenil chloroquine phosphate uk cialis pro where can i buy doxycycline without prescription buy cialis 100mg

  20. AmyDes
    AmyDes
    回复

    buy cialis daily online

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