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

Validation 证书验证使用internet进行不必要的验证?,validation,certificate,sql-server-ce,Validation,Certificate,Sql Server Ce,我有一个从高速扫描设备接收项目的应用程序。在接收项目时,使用SQL Compact将其写入磁盘。使用以下数字签名的Microsoft DLL: sqlceca40.dll sqlcecompact40.dll sqlceer40EN.dll sqlceme40.dll sqlceoledb40.dll sqlceqp40.dll sqlcese40.dll 我收到一位客户的性能投诉,并使用Microsoft Procmon跟踪问题,当我们

我有一个从高速扫描设备接收项目的应用程序。在接收项目时,使用SQL Compact将其写入磁盘。使用以下数字签名的Microsoft DLL:

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

我试图通过将我们的机器设置为一台不存在的机器来重新创建问题。在我最初的尝试中,我仍然从我们的应用程序中获得了良好的性能,并且没有尝试联系互联网进行证书验证。查看证书的验证链后,我注意到它来自证书“Microsoft根证书颁发机构”。然后,我导出并删除了该证书,并能够根据日志比较结果重现该问题

我做了以下测试:

    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->certificates local computer的“Trusted Roots certificates”文件夹中的证书时。“MicrosoftRootCertificateAuthority”证书确实出现在那里,它似乎与我的相同。然而,由于某些原因,使用dll会导致证书验证尝试访问internet,从而导致性能问题

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

我的问题是,是否存在可能导致证书验证始终尝试使用internet的设置(注册表或GPO),而不管验证链的根证书是否安装在本地计算机中

例如,是否可以启用使证书验证访问internet以检查根证书是否已吊销的设置


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

对于SQL Server Compact 4.0,在任何具有无效代理配置的系统上都会出现这种情况,因为每次加载引擎时都会运行证书吊销列表检查(第一次调用.Open())

解决方案:为避免此延迟(可能会影响相关系统上的任何已签名应用),您必须修复配置或禁用检查。可以通过UI或注册表设置禁用检查,如下所述:


有关其他问题,请参阅我的博客帖子:

我有一些建议:嗨,埃里克。好文章。它解释了我们经历的许多影响。你能提出这个作为回答吗?我已经要求进行测试,以验证此信息是否会导致修复,但这项工作正在进行中。根据我目前的测试,我希望这能导致一个解决方案。如果是的话,我想把它标记为一个答案。