Trim self-signed roots from client certificates before sending them.
Trim self-signed roots from client certificates before sending them.

IE removes self-signed roots from chains before sending them. This
should be a no-op, but, in TLS 1.2, IIS will reject connections which
present certificates with bad signature algorithms (whether or not
the certificates are relevant for authentication). In prior versions
of TLS, those connections will be fine. This causes us to be reliant
on the TLS version fallback.

Notably, it is possible for an organization to have a weak signature
on the root (which was never rotated because the signature is usually
ignored) despite having migrated their leaves to better algorithms.
By matching IE, we avoid the reliance on the version fallback in this
case.

It is possible some other organization has weak signatures on other
certificates in the chain. Those we consider a configuration error
and will not attempt to work around. The set of algorithms accepted
by TLS 1.2 code should match those accepted by the X.509 logic it
calls out to in any version of TLS. The root is different because it
will not be part of the final chain. (IIS's TLS 1.2 vs. TLS 1.1
discrepancy comes from it rejected presented certificates *before*
path-building.)

(Only do this in the Windows logic. Empirically, the OS X code already
avoids sending the root and we do not currently do client certificate
path-building on other platforms.)

BUG=607264

Review-Url: https://codereview.chromium.org/1937503002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#390816}

axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk