"Add to home screen" 图标无法在 iOS 13 使用 HTTPS

"Add to home screen" icon not working on iOS 13 with HTTPS

使用 iOS 13,"Add to Home Screen" 图标不再填充,并保留页面的屏幕截图:

iOS13 在 iPad 上的图像:https://i.ibb.co/StxckYP/20191017-125540.jpg

iOS在13之前,正常创建图标:

iPod 上 iOS 12 的图像:https://i.ibb.co/JqVFZgd/20191017-125423.jpg

这似乎是一个证书问题,因为它通常通过 HTTP 填充。它还适用于全球 CA 签名证书 (GoDaddy)。使用私有 CA 签名证书则不会。

两种情况下的服务器都是IIS。页面在其他方面通过 HTTPS 正常工作。

图标的元标记:

<link id="apple-touch-icon" rel="apple-touch-icon" href="resources/images/app-test114.png">

用于创建 CA 的批处理脚本:

openssl req -x509 -newkey rsa:1024 -sha256 -days 3650 -nodes -keyout ca.key -out ca.crt -config ca.conf
openssl pkcs12 -export -out ca.pfx -inkey ca.key -in ca.crt
pause

CA 的配置文件:

[req]
distinguished_name=information
prompt=no
x509_extensions=v3_ca

[information]
C=...
ST=...
L=...
O=...
OU=...
CN=...

[v3_ca]
subjectKeyIdentifier=hash
extendedKeyUsage=critical,serverAuth,clientAuth
basicConstraints=CA:true
keyUsage=cRLSign,keyCertSign,digitalSignature,nonRepudiation,keyEncipherment,dataEncipherment,keyAgreement,keyCertSign,cRLSign

创建虚拟主机证书的批处理脚本:

openssl req -newkey rsa:1024 -sha256 -nodes -keyout cert.key -out cert.csr -config cert.conf
openssl x509 -sha256 -req -in cert.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out cert.crt -days 365 -extfile cert.conf -extensions extensions
openssl pkcs12 -export -out cert.pfx -inkey cert.key -in cert.crt
pause

证书的配置文件:

[req]
distinguished_name=information
prompt=no

[information]
C=...
ST=...
L=...
O=...
OU=...
CN=...

[extensions]
subjectAltName=@alt_names

[alt_names]
DNS.1=localhost
IP.1=192.168.77.132

在获得正确的证书之前,当我不得不允许某个 URL 使用不安全的 https 连接打开时,行为是相同的。修复证书后,图标就会正常填充。随着更新到 iOS 13,图标停止正常工作。

有什么办法可以查出图标加载不出来的原因吗?

Hudgi 的 link 解决了这个问题。

https://support.apple.com/en-us/HT210176

要求密钥大小为2048位,而我的密钥是1024位。 页面以其他方式工作的原因是它被缓存了。