当 Cloudflare 无法验证服务器的 SSL/TLS 证书时触发 Cloudflare 错误 526。 Cloudflare 中的 Full SSL(Strict) 模式通常会发生这种情况。
你在cloudflare中使用的是什么模式?完全(严格)模式?
如果是,请查看:
Full (strict) mode is the most common reason for the 526 error. A quick fix to solve it would be to change the SSL mode to Full instead of Full (strict) from the Overview tab of Cloudflare SSL/TLS section for the particular domain.
If the issue persists even after changing the SSL mode to Full, then it would be more likely related to the origin web server’s SSL certificates. We need to verify that:
1. The certificate is not expired
2. The certificate is not revoked
3. The certificate is signed by a Certificate Authority such as GlobalSign, Verisign, GeoTrust, Comodo, etc, and is not a self-signed SSL certificate.
4. The requested domain name and hostname are in the certificate’s Common Name or Subject Alternative Name.
5. Origin web server accepts connections over port SSL port 443
6. Temporarily pause Cloudflare and cross-check the certificate with any SSL verification sites like https://www.sslshopper.com to verify that no issues exist with the origin SSL certificate.
If the origin server is using an expired, revoked or self -signed certificate, the next step to fix this error would be to install a proper SSL certificate signed by a Certificate Authority.
Likewise, it is important to have the requested domain name and hostname in the certificate’s Common Name or Subject Alternative Name. If we have added a CNAME for the hostname on Cloudflare, the Common Name or SAN may also match the CNAME target.
Cloudflare can also issue origin certificates to you on request if you don’t want to pay for or acquire one from a third-party. The 526 error should disappear after the installation of a valid certificate on the origin server and the server it accept secure (HTTPS) connections.
如果你想改变其他模式:
在 CloudFlare 面板中 Domain -> SSL/TLS -> Overview -> Pick the mode)。当您选择一种模式时,它会显示加密的工作方式。
如果您在端点中使用 80/tcp 端口,则需要使用灵活模式(加密浏览器和 Cloudflare 之间的流量)。
但是,如果您在端点中使用 443/tcp 端口,则需要使用完全模式(端到端加密,使用服务器上的自签名证书)。对于可在您的虚拟主机中使用自签名 SSL 证书的完整模式。