如果必须使用Active Directory进行身份验证,是否应将LDAPS证书导入每台客户端计算机?

时间:2015-11-04 17:13:53

标签: ssl active-directory ldap ssl-certificate communication

我是LDAP,SSL和AD的新手。试图了解如何解决这个问题,但即使在google上进行大量搜索后也找不到某些问题的答案。

安装AD证书颁发机构后,它会生成一个必须在AD域控制器中导入的证书。它是否正确? 这次导入是一次性设置吗?

如果客户端计算机上有要对AD进行身份验证的软件,是否应将证书导入客户端计算机?

只需将协议设置为" SSL"在客户端机器上的软件没有帮助。是否应将证书导入到必须与AD通信的每台客户端计算机的证书存储区中?

2 个答案:

答案 0 :(得分:0)

不需要在客户端计算机上导入证书。如果您使用的是自签名证书或来自内部CA的证书,则需要确保证书的颁发链最终在客户端计算机上受信任。

您还需要确保DC正在收听636/3269。

您可以使用RSAT工具中包含的ldp实用程序来测试客户端。

答案 1 :(得分:0)

否,不应将其导入每台计算机,但是,创作授权(CA)应该安装在每台使用LDAP的计算机上的“受信任的根证书颁发机构”中。您的AD证书应安装在服务端下方。这是一个将证书安装到正确位置的脚本。安装完成后,建议您使用LDP.exe实用程序进行验证。该脚本将使用PFX证书文件。该脚本会将其复制到根目录上的本地C驱动器中,然后在完成后将其删除。您将需要更新以下内容:

路径可以是 UNC 本地

$ cert_name =“ FullNameOfCertPfx.pfx

$ cert_path =“ 此处的路径名 \ $ cert_name”

$ pwd =“ 在此处输入您的PFX密码

$dcs = Get-ADDomainController -Filter * | sort name
for($i =0; $i -lt $dcs.Count; $i++)
{
    $cert_name = "**FullNameOfCertPfx.pfx**"
    $cert_path = "**PathNameHere**\$cert_name"
    $cert_dst = "\\" + $dcs[$i].name + "\c$\"

    #This will copy it to the DC
    Copy-Item -Path $cert_path -Destination $cert_dst -Force -Confirm: $false -Verbose

    Write-Verbose $dcs[$i].name -Verbose

    Invoke-Command -ComputerName $dcs[$i].name -ScriptBlock {
        $pwd = "Put your PFX Password here"
        $cert_pwd = ConvertTo-SecureString -String $pwd -AsPlainText -Force
        $cert = Import-PfxCertificate -Password $cert_pwd -FilePath "C:\star_corp-nutanix-with-key.pfx" cert:\localMachine\my -Verbose
        $reg_path = "HKLM:\SOFTWARE\Microsoft\SystemCertificates\MY\Certificates\$($cert.Thumbprint)"
        $reg_dst = "HKLM:\SOFTWARE\Microsoft\Cryptography\Services\NTDS\SystemCertificates\MY\Certificates\"
        if(!(Test-Path $reg_dst))
        {
            if(!(Test-Path "HKLM:\SOFTWARE\Microsoft\Cryptography\Services\NTDS"))
            {
                New-Item -Path "HKLM:\SOFTWARE\Microsoft\Cryptography\Services\" -Name "NTDS" -Verbose
            }
            if(!(Test-Path "HKLM:\SOFTWARE\Microsoft\Cryptography\Services\NTDS\SystemCertificates"))
            {
                New-Item -Path "HKLM:\SOFTWARE\Microsoft\Cryptography\Services\NTDS" -Name "SystemCertificates" -Verbose
            }
            if(!(Test-Path "HKLM:\SOFTWARE\Microsoft\Cryptography\Services\NTDS\SystemCertificates\My"))
            {
                New-Item -Path "HKLM:\SOFTWARE\Microsoft\Cryptography\Services\NTDS\SystemCertificates" -Name "My" -Verbose
            }
            if(!(Test-Path "HKLM:\SOFTWARE\Microsoft\Cryptography\Services\NTDS\SystemCertificates\My\Certificates"))
            {
                New-Item -Path "HKLM:\SOFTWARE\Microsoft\Cryptography\Services\NTDS\SystemCertificates\My" -Name "Certificates" -Verbose
            }
        }
        else{Write-Verbose "Path is there" -Verbose}
        Move-Item $reg_path $reg_dst -Verbose
        Remove-Item -Path "c:\$cert_name" -Verbose
    }
}
相关问题