今天有人反馈说,小程序加载的内容都没了。问了一下貌似是服务器的ssl证书过期了,之前用的certbot申请的免费证书,今天再次申请的时候certbot出错了,没法继续。
requests SSLCertVerificationError

Traceback (most recent call last): File "requests\adapters.py", line 439, in send File "urllib3\connectionpool.py", line 785, in urlopen File "urllib3\util\retry.py", line 592, in increment urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.jpmn8.cc', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1124)')))
Litespeed Cache https模式下css/js 加载失败
安装litespeed插件并且开启之后,发现原有的页面样式丢失了。导致这个问题的原因在于虽然访问的是https的链接,但是资源文件依旧是http协议加载的,所以就直接挂掉了。解决这个问题最简单的办法应该是开启全站https,但是我并不想这么干,想依旧提供http访问的能力。于是找各种解决方法,网上提供的解决方案包含但不限于下面这几种:
1. 通过插件解决:例如Really Simple SSL等进行样式修复,但是我安装了没有效果。
2.通过修改functions.php添加以下代码(无效):
add_filter('script_loader_src', 'agnostic_script_loader_src', 20,2); function agnostic_script_loader_src($src, $handle) { return preg_replace('/^(http|https):/', '', $src); } add_filter('style_loader_src', 'agnostic_style_loader_src', 20,2); function agnostic_style_loader_src($src, $handle) { return preg_replace('/^(http|https):/', '', $src); }