使用 Internet 进行不必要的证书验证?

Certificate validation using internet to validate unnecessarily?

我有一个从高速扫描仪设备接收项目的应用程序。收到项目后,使用 SQL Compact 将它们写入磁盘。使用以下经过数字签名的 Microsoft DLL:

    sqlceca40.dll
    sqlcecompact40.dll
    sqlceer40EN.dll
    sqlceme40.dll
    sqlceoledb40.dll
    sqlceqp40.dll
    sqlcese40.dll

我收到客户的性能投诉,并使用 Microsoft Procmon 将问题追溯到当我们调用这些 dll 中的方法时尝试联系站点进行证书验证时出现 TCP 重新连接失败。起初,我无法在本地重现该问题。在与他们的基础架构人员和开发人员交谈后,我了解到他们必须使用代理来连接互联网。一些客户的用户(在测试环境中)具有有效的代理设置,并且他们从我们的应用程序中获得了良好的性能。当然,当他们关闭代理设置时,无法完成验证并出现性能问题。

我试图通过将我们的机器设置为不存在的机器的错误代理设置来重现该问题。在我最初的尝试中,我仍然从我们的应用程序中获得了良好的性能,并且没有尝试联系互联网进行证书验证。查看证书的验证链后,我注意到它源自证书 "Microsoft Root Certificate Authority"。然后我导出并删除了该证书,并且能够重现通过比较日志确定的问题。

我做了以下测试:

    Test 1:
    1. Opened the proxy settings, and enabled them pointing to a non-existent address.
    2. Ran a test.   
    Results: No performance issue.

    Test 2:
    1. Exported the “Microsoft Root Certificate Authority” cert and moved it to the untrusted folder.
    2. Ran a test.  
    Results: The performance issue occurred.

    Test 3:
    1. Deleted the “Microsoft Root Certificate Authority” cert.
    2. Started a test.  
    Results: The performance issue began occuring.
    3. While the test was in progress and device was hesitating I removed the false proxy settings.  
    Results: The performance issue disappeared and the application recovered.

    Tentative Conclusions:
    1. That I can simulate the no internet access condition by providing false proxy settings.
    2. If the “Microsoft Root Certificate Authority” cert is installed properly, the .Net infrastructure does not need to access the network to verify the necessary cert.
    3. If not, it will attempt to validate via the internet connection.

然而,当客户检查mmc->证书-本地计算机的"Trusted Roots Certificates"文件夹中的证书时。 "Microsoft Root Certificate Authority" 证书确实出现在那里,它似乎与我的相同。然而由于某种原因,使用 dll 会导致证书验证尝试访问 Internet,从而导致性能问题。

在客户的情况下,最终设备将在没有互联网访问的情况下用于生产。

我的问题是,是否存在可能导致证书验证始终尝试使用 Internet 的设置(注册表或 GPO),无论本地计算机上是否安装了验证链的根证书?

是否可以启用导致证书验证访问 Internet 以检查根证书是否已被吊销等设置?

如果您需要更多信息,请随时提问。

对于代理配置无效的任何系统上的 SQL Server Compact 4.0,这似乎会发生,因为每次加载引擎时都会进行证书吊销列表检查 运行(发生在首先调用 .Open())。

解决方案:为避免这种可能影响系统上任何已签名应用程序的延迟,您必须修复配置或禁用检查。可以通过 UI 或注册表设置禁用检查,如下所述:http://digital.ni.com/public.nsf/allkb/18E25101F0839C6286256F960061B282

有关其他问题,请在此处查看我的博客 post:http://erikej.blogspot.com/2013/08/faq-why-is-opening-my-sql-server.html