Windows Server:如何在 Active Directory 域控制器上启用安全轻型目录访问协议 (LDAPS)

Summary: 本文提供了在 Active Directory 域控制器上启用安全 LDAP 的步骤。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

轻型目录访问协议 (LDAP) 是 Active Directory 域服务的核心协议之一。安全 LDAP(LDAPS 或 LDAP over SSL 或 TLS)提供了一种通过加密来保护 LDAP 通信的方法。
 
提醒:在此过程结束时,必须重新启动域控制器。根据环境的不同,可能需要计划的维护窗口。

必须在 DC 上生成并安装相应的证书,以便 DC 使用 LDAPS。以下内容可用作证书请求的模板:

 

;----------------- request.inf -----------------

[Version]

Signature="$Windows NT$

[NewRequest]

Subject = "CN=<DC_fqdn>" ; replace with the FQDN of the DC
KeySpec = 1
KeyLength = 1024
; Larger key sizes (2048, 4096, 8192, or 16384)
; can also be used. They are more secure but larger
; sizes have a greater performance impact.
Exportable = TRUE
MachineKeySet = TRUE
SMIME = False
PrivateKeyArchive = FALSE
UserProtected = FALSE
UseExistingKeySet = FALSE
ProviderName = "Microsoft RSA SChannel Cryptographic Provider"
ProviderType = 12
RequestType = PKCS10
KeyUsage = 0xa0

[EnhancedKeyUsageExtension]

OID=1.3.6.1.5.5.7.3.1 ; Server Authentication

;-----------------------------------------------


要生成 LDAPS 证书,请将上面的文本复制到记事本中。将“主题”行中的DC_fqdn>更改为<安装证书的 DC 的完全限定域名(例如,dc1.ad.domain.com)。

根据证书颁发机构 (CA),可能还需要以下部分或全部信息:

  • 电子邮件地址 (E)
  • 组织单位 (OU)
  • 组织 (O)
  • 城市或地点 (L)
  • 省/自治区/直辖市 (S)
  • 国家或地区 (C)
所有这些信息都可以添加到 “主题 ”行,如以下示例所示:
Subject="E=user@domain.com, CN=dc1.ad.domain.com, OU=Information Technology, O=Company, L=Anywhere, S=Kansas, C=US"
将文本文件另存为 request.inf,然后运行 certreq -new request.inf request.req 从命令提示符。这将使用文本文件中提供的信息生成名为 request.req 的证书请求。

生成请求后,必须将其提交给 CA。提交过程无法在此处记录,因为它取决于 CA。

CA 生成证书,必须将其下载到 DC。下载过程也会有所不同, 但证书必须编码为 base64

将 DC 上的证书另存为 ldaps.cer, 然后运行 certreq -accept ldaps.cer 完成挂起的请求并安装证书。默认情况下,证书安装在 DC 的个人存储中;证书 MMC 管理单元可用于确认这一点。

现在必须重新启动 DC。当 DC 启动回 Windows 时,LDAPS 会自动用于 LDAP 通信;无需进一步配置。

Additional Information

运行 netstat 命令会显示 lsass.exe 进程侦听 TCP 端口 389 和 636,无论是否已遵循上述过程。但是,在安装适当的证书之前,无法使用 LDAPS。

ADSI 编辑工具可用于确认 LDAPS 正在使用中:

  1. 启动 ADSI Edit (adsiedit.msc)时,此方法起作用。
  2. 在左窗格中,右键单击 ADSI 编辑 ,然后选择 连接到...。
  3. 从下拉菜单中选择命名上下文。
  4. 选中 Use SSL-based encryption
  5. 单击 高级...。
  6. 输入 636 作为端口号,然后单击 OK。
  7. 端口 636 应显示在窗口顶部附近的 Path 字段中。单击 OK 进行连接。
  8. 如果连接成功,则表示 LDAPS 正在使用中。

Affected Products

Microsoft Windows Server 2016, Microsoft Windows Server 2019, Microsoft Windows Server 2022

Products

PowerEdge FC640, PowerEdge M640, PowerEdge M640 (for PE VRTX), PowerEdge MX5016s, PowerEdge MX740C, PowerEdge MX750c, PowerEdge MX760c, PowerEdge MX840C, PowerEdge R240, PowerEdge R250, PowerEdge R260, PowerEdge R340, PowerEdge R350, PowerEdge R360 , PowerEdge R440, PowerEdge R450, PowerEdge R540, PowerEdge R550, PowerEdge R640, PowerEdge R6415, PowerEdge R650, PowerEdge R650xs, PowerEdge R6515, PowerEdge R6525, PowerEdge R660, PowerEdge R660xs, PowerEdge R6615, PowerEdge R6625, PowerEdge R740, PowerEdge R740XD, PowerEdge R740XD2, PowerEdge R7415, PowerEdge R7425, PowerEdge R750, PowerEdge R750XA, PowerEdge R750xs, PowerEdge R7515, PowerEdge R7525, PowerEdge R760, PowerEdge R760XA, PowerEdge R760xd2, PowerEdge R760xs, PowerEdge R7615, PowerEdge R7625, PowerEdge R840, PowerEdge R860, PowerEdge R940, PowerEdge R940xa, PowerEdge R960, PowerEdge T140, PowerEdge T150, PowerEdge T160, PowerEdge T340, PowerEdge T350, PowerEdge T360, PowerEdge T40, PowerEdge T440, PowerEdge T550, PowerEdge T560, PowerEdge T640 ...
Article Properties
Article Number: 000212661
Article Type: How To
Last Modified: 11 Dec 2024
Version:  4
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.