Sha*_*aan 2 ssl-certificate certificate-authority windows-server-2016
在公司,我们从来没有真正关心根证书,并且印象中这是与 Windows 更新一起管理的东西(并且有 WSUS),一切都很好。
然而,今天,我注意到全新安装的 Windows Server 2016(包含所有更新)似乎只有非常非常基本的根证书,以至于我什至无法打开 Google(因为不信任他们的证书) )。
(我还没有检查全新的 Windows 10 安装...)
我对此感到有点困惑,因为以前没有发生过这种情况。要么我们对 GPO 进行了一些糟糕的更改(尽管我想不出任何会产生这种效果的更改),要么这是最近更改的内容?我应该如何操作才能顺利访问 Google 等内容?我现在需要通过 GPO 手动添加受信任的证书吗?
以下是新安装的服务器上的情况的一些屏幕截图。
这是正常且预期的行为。默认情况下,受信任的根存储中只有少数必需的证书可见。其余的(大约有 300 个根)是在您第一次面对它们时按需安装的。Windows 更新中存在根证书的隐藏副本Crypt32.dll
。没有什么可担心的。
更新:
我进行了内部检查,发现请求的根目录嵌入在crypt32.dll
文件中。以下是 PowerShell 代码,您可以从此 dll 中提取嵌入的证书并找到所需的根:
$signature = @"
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern IntPtr LoadLibraryEx(
String lpFileName,
IntPtr hFile,
UInt32 dwFlags
);
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr FindResource(
IntPtr hModule,
int lpID,
string lpType
);
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern uint SizeofResource(
IntPtr hModule,
IntPtr hResInfo
);
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr LoadResource(
IntPtr hModule,
IntPtr hResInfo
);
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool FreeLibrary(
IntPtr hModule
);
"@
Add-Type -MemberDefinition $signature -Namespace PKI -Name Kernel32
$path = $Env:SystemRoot + "\System32\crypt32.dll"
$hModule = [PKI.Kernel32]::LoadLibraryEx($path,[IntPtr]::Zero,0x2)
$hResInfo = [PKI.Kernel32]::FindResource($hModule,1010,"AUTHROOTS")
$size = [PKI.Kernel32]::SizeOfResource($hModule, $hResInfo)
$resource = [PKI.Kernel32]::LoadResource($hModule, $hResInfo)
$bytes = New-Object byte[] -ArgumentList $size
[Runtime.InteropServices.Marshal]::Copy($resource, $bytes, 0, $size)
$AUTHROOTS = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection
$AUTHROOTS.Import($bytes)
[void][PKI.Kernel32]::FreeLibrary($hModule)
$AUTHROOTS | ?{$_.thumbprint -eq "75E0ABB6138512271C04F85FDDDE38E4B7242EFE"}
Run Code Online (Sandbox Code Playgroud)
只需将此代码复制粘贴到 PS 控制台并检查是否返回任何对象/
归档时间: |
|
查看次数: |
12792 次 |
最近记录: |