0

Apple's Secure Transport API defines a function, SSLSetCertificate, of which the certRefs parameter is an array of certificates. The documentation states (emphasis added):

You must place in certRefs[0] a SecIdentityRef object that identifies the leaf certificate and its corresponding private key. Specifying a root certificate is optional; if it’s not specified, the root certificate that verifies the certificate chain specified here must be present in the system wide set of trusted anchor certificates.

Whilst it says "the root certificate…must be present", it's not clear whether trust chains so found will actually be provided to the SSL peer (albeit it's difficult to think of any other reason for that requirement to exist).

  1. How does one ensure that the full certificate chain (back to a self-signed root, or else a system trust anchor) is provided to the peer?

  2. In particular, must all constituent certificates be included in this certRefs parameter (or does that have no bearing)?

Background

This question follows an earlier post on ServerFault. Having now RTFS, it's clear that slapd calls SSLSetCertificate with only the host's identity certificate and at no stage attempts to furnish Secure Transport with the certificate chain—perhaps that's okay (because Secure Transport is supposed to sort it all out), but I have a hunch this might be the cause of the problem.

4

1 回答 1

0

好的,我已经通过libsecurity_ssl并相信:

我总结:

  1. 如何确保向对等方提供完整的证书链(返回自签名根,或者系统信任锚)?

    传给SSLSetCertificate.

  2. 特别是,所有组成证书是否必须包含在此参数certRefs中(或者没有影响)?

    从文档和代码注释来看,Apple 的意图可能是在未来改变这一点,但就目前而言……是的,他们必须这样做。

于 2014-12-18T14:10:58.000 回答