1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
openssl genrsa -out ca.key 4096 openssl req -x509 -new -nodes -sha512 -days 3650 \ -subj "/C=CN/ST=Zhejiang/L=Hangzhou/O=register/OU=Personal/CN=registry.k8s.com" \ -key ca.key \ -out ca.crt
openssl genrsa -out registry.k8s.com.key 4096 openssl req -sha512 -new \ -subj "/C=CN/ST=Zhejiang/L=Hangzhou/O=register/OU=Personal/CN=registry.k8s.com" \ -key registry.k8s.com.key \ -out registry.k8s.com.csr cat > v3.ext <<-EOF authorityKeyIdentifier=keyid,issuer basicConstraints=CA:FALSE keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment extendedKeyUsage = serverAuth subjectAltName = @alt_names
[alt_names] DNS.1=registry.k8s.com DNS.2=registry.k8s DNS.3=localhost.localdomain EOF
openssl x509 -req -sha512 -days 3650 \ -extfile v3.ext \ -CA ca.crt -CAkey ca.key -CAcreateserial \ -in registry.k8s.com.csr \ -out registry.k8s.com.crt
|