OSCP服务连通性问题

MACOS/IOS 都开启了OSCP检查,Chrome早在2012年就关闭了OSCP检查,这个检查从客户端发起额外的请求,Let’s encypt的证书,配置的OSCP服务器是: ocsp.int-x3.letsencrypt.org,通讯通过80端口。

可惜的是,这个服务在国内的可访问性很差,所以客户端在检查时耗费了大量的时间,导致超时。

之前有时候快,有时候慢,就是因为这地址解析出来的IP是轮换的,有的可以联通有的不行。

解决方式,通过WebServer的ssl_stapling解决:

OCSP Stapling(OCSP 封套),是指服务端在证书链中包含颁发机构对证书的 OCSP 查询结果,从而让浏览器跳过自己去验证的过程。

同时,为了解决服务器到 ocsp.int-x3.letsencrypt.org 的访问问题,修改host加入经过测试的可访问的IP地址解决。

终极解决方案还是要买证书!

工具

  • 检查OSCP是否开启:

https://www.getssl.cn/ocsp

Nginx上的配置

1
2
3
4
5
6
7
8
http
{
    server
    {
        ssl_stapling on;
        ssl_stapling_verify on;
    }
}

IIS上的配置

1
2
3
4
5
6
7
To enable OCSP stapling for SNI and CCS bindings, locate the following registry subkey:

[HKLM\\Sysytem\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL]

To this subkey, add the following key:

"EnableOcspStaplingForSni"=dword:00000001

其他优化

开启HTTP2,速度快了一些,但是还能看到SSL握手时间太长。

SSL issue on iOS with Nginx reverse proxy