大网数据广告活动
服务器运维问答

SSLVerifyDepth explaination

· 52CE 我爱测

Is there a comprehensive explanation how exactly does certificate chain verification work in apache httpd and how exactly does the SSLVerifyDepth parameter affect it? Possibly as pseudo-code. Most references just casually mention…

问题原文

原帖链接 · David Balažic · CC BY-SA 4.0

Is there a comprehensive explanation how exactly does certificate chain verification work in apache httpd and how exactly does the SSLVerifyDepth parameter affect it? Possibly as pseudo-code.

Most references just casually mention it.

已采纳解答

原帖链接 · David Balažic · CC BY-SA 4.0

As per my tests (see this comment) and this answer, the certificate chain verification in apache works like this:

current_certificate := client_certificate_from_request
current_depth := 0
LOOP
  if current_certificate IS self-signed (ie. root)
    if current_certificate IS IN SSLCACertificateFile
      THEN RETURN true // cert is accepted as valid
      ELSE RETURN false // validation failed
    end if
  end if

  current_certificate := current_certificate.getIssuer()
  current_depth += 1
  if current_depth > SSLVerifyDepth
    THEN RETURN false // validation failed
END LOOP // repeat

In words:

The final root certificate must be in the SSLCACertificateFile (or alternatively in SSLCACertificatePath) otherwise the client certificate is not accepted valid. The SSLVerifyDepth parameter limits how far the chain will apache look. If the limit is reached, the certificate is rejected.

The intermediate certificates listed in SSLCACertificateFile only affect building the chain (for example when the client does not send the full chain, so without those listed on the SSLCACertificateFile apache httpd would not have a way to reach the root certificate), but the validity depends only on the presence of the root certificate in SSLCACertificateFile.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-08-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。