码迷,mamicode.com
首页 > 其他好文 > 详细

[k8s]通过openssl生成证书

时间:2017-11-24 19:14:49      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:ast   x509   serial   原理   open   default   mes   ons   nat   

证书认证原理:
http://www.cnblogs.com/iiiiher/p/7873737.html

[root@m1 ssl]# cat master_ssl.cnf 
[req]
req_extensions = v3_req
distinguished_name = req_distinguished_name
[ req_distinguished_name ]
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = kubernetes
DNS.2 = kubernetes.default
DNS.3 = kubernetes.default.svc
DNS.4 = kubernetes.default.svc.cluster.local
DNS.5 = m1.ma.com
IP.1 = 10.254.0.1



openssl genrsa -out ca.key 2048
openssl req -x509 -new -nodes -key ca.key -subj "/CN=m1.ma.com" -days 5000 -out ca.crt

openssl genrsa -out server.key 2048
openssl req -new -key server.key -subj "/CN=m1.ma.com" -config master_ssl.cnf -out server.csr
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -days 5000 -extensions v3_req -extfile master_ssl.cnf -out server.crt

[k8s]通过openssl生成证书

标签:ast   x509   serial   原理   open   default   mes   ons   nat   

原文地址:http://www.cnblogs.com/iiiiher/p/7891669.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!