Harbor login 一直提示失败的一个原因,重启docker 证书文件清空

查看/etc/docker/certs.d目录下证书是否存在

重新生成:

openssl genrsa -out ca.key 4096

openssl req -x509 -new -nodes -sha512 -days 3650 \
    -subj "/C=TW/ST=Taipei/L=Taipei/O=example/OU=Personal/CN=harbor.test.com" \
    -key ca.key \
    -out ca.crt


openssl req -sha512 -new \
    -subj "/C=TW/ST=Taipei/L=Taipei/O=example/OU=Personal/CN=harbor.test.com" \
    -key harbor.test.com.key \
    -out harbor.test.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=harbor.test.com
DNS.2=harbor.test
DNS.3=harbor.test
EOF

openssl x509 -req -sha512 -days 3650 \
    -extfile v3.ext \
    -CA ca.crt -CAkey ca.key -CAcreateserial \
    -in harbor.test.com.csr \
    -out harbor.test.com.crt

openssl x509 -inform PEM -in harbor.test.com.crt -out harbor.test.com.cert


 cp harbor.test.com.cert /etc/docker/certs.d/harbor.test.com/
  cp harbor.test.com.key /etc/docker/certs.d/harbor.test.com/
  cp ca.crt /etc/docker/certs.d/harbor.test.com/

 

你可能感兴趣的:(分布式架构,k8s探险记)