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

时间:2018-09-07 16:39:58

标签: validation certificate sql-server-ce

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

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

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

我尝试通过使用错误的代理设置将我们的机器设置为不存在的机器来重新创建该问题。在最初的尝试中,我的应用程序仍然具有良好的性能,并且没有尝试与Internet进行证书验证。在查看了证书的验证链之后,我注意到它源自证书“ 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计算机的“受信任的根证书”文件夹中的证书时。确实出现了“ Microsoft根证书颁发机构”证书,并且它似乎与我的证书相同。但是由于某种原因,使用dll导致证书验证尝试访问Internet,从而导致性能问题。

根据客户的情况,最终将在没有Internet访问的情况下将设备用于生产。

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

例如,是否可以启用一项设置,以使证书验证访问互联网以查看是否已撤销根证书?

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

1 个答案:

答案 0 :(得分:0)

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

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

有关其他问题,请参阅我的博客文章:http://erikej.blogspot.com/2013/08/faq-why-is-opening-my-sql-server.html