下载失败:org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://192.168.1.1:80/api/admin/image/local/c639a28c6e4b4278b8c93ff94352957a.txt": sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
解决方法:
1.重新自包含签证书SAN(Subject Alternative Name)的证书
bash复制代码
openssl genrsa -out server.key 2048
cat >server.cnf<<EOF
[req]
default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = dn
req_extensions = req_ext
[dn]
C = CN
ST = Province
L = City
O = Organization
OU = Organizational Unit
CN = test
[req_ext]
subjectAltName = @alt_names
[alt_names]
# 如果需要,可以添加更多的DNS或IP地址
#DNS.1 = baidu.com
IP.1 = 192.168.1.1
IP.2 = 192.168.1.2
EOF
openssl req -new -sha256 -key server.key -config server.cnf -out server.csr
openssl x509 -req -days 3650 -in server.csr -signkey server.key -extfile server.cnf -extensions req_ext -out server.crt