<div dir="ltr">Hi<div><br></div><div>Following on from:</div><div><a href="https://bugs.openjdk.org/browse/JDK-8320362">https://bugs.openjdk.org/browse/JDK-8320362</a></div><div><br></div><div>It's now possible to get system roots on macOS devices in the truststore: KeychainStore-ROOT.</div><div>That's quite useful.</div><div><br></div><div>Unfortunately it doesn't cover everything though.</div><div>In practice there's two issues I've found in trying to use it:</div><div><br></div><div>1. It is missing custom CA certificates, (which would have been included if Apple APIs - SecTrustCopyCustomAnchorCertificates were used, see discussion at <a href="https://github.com/openjdk/jdk/pull/16722#issuecomment-1948542783">https://github.com/openjdk/jdk/pull/16722#issuecomment-1948542783</a>)</div><div>2. It is missing intermediate certificates which are required for custom CA certificates, (these are not included with SecTrustCopyCustomAnchorCertificates although the root CAs above are).</div><div><br></div><div>The architecture at my company that is using ZScaler MiTM proxy is:</div><div>Root CA -> Intermediate 1 -> Intermediate 2 -> Leaf</div><div><br></div><div>Where:</div><div><ul><li>All certs are in admin domain kSecTrustSettingsDomainAdmin</li><li>Root CA is marked as always trust</li><li>Intermediate 1 and 2 are Unspecified</li></ul><div>Not all certificates get re-signed by Zscaler, some URLs are bypassed.</div><div>So I need to be able to trust both custom CAs and the predefined roots.</div><div><br></div><div>I was thinking of creating a new truststore: KeychainStore-ALL.</div><div>I think it could just reuse all the existing code, and work pretty seamlessly, (I have a separate patch for intermediate certs not working correctly - <a href="https://github.com/openjdk/jdk/pull/22911">https://github.com/openjdk/jdk/pull/22911</a>).</div><div><br></div><div>It could be improved at the expense of more code to use the Apple APIs directly (SecTrustCopyCustomAnchorCertificates) and not read the keychain file.</div><div><br></div><div>What do you think?</div><div><br></div><div>Thanks</div><div>Tim</div><div><br></div></div></div>