According to [1], GnuTLS and NSS do that by default.
Use case: Chrome and Mozilla no longer trust Semantic root CAs _but_
still trust several whitelisted Semantic intermediate CAs[2]. Squid
built with OpenSSL cannot do that without X509_V_FLAG_PARTIAL_CHAIN.
[1] https://www.openldap.org/lists/openldap-devel/201506/msg00012.html
[2] https://wiki.mozilla.org/CA/Additional_Trust_Changes#Symantec
updateContextNpn(t);
updateContextCa(t);
updateContextCrl(t);
+ updateContextTrust(t);
}
return t;
#endif /* USE_OPENSSL */
}
+void
+Security::PeerOptions::updateContextTrust(Security::ContextPointer &ctx)
+{
+#if USE_OPENSSL
+#if defined(X509_V_FLAG_PARTIAL_CHAIN)
+ const auto st = SSL_CTX_get_cert_store(ctx.get());
+ assert(st);
+ if (X509_STORE_set_flags(st, X509_V_FLAG_PARTIAL_CHAIN) != 1) {
+ debugs(83, DBG_IMPORTANT, "ERROR: Failed to enable trust in intermediate CA certificates: " <<
+ Security::ErrorString(ERR_get_error()));
+ }
+#endif
+#elif USE_GNUTLS
+ // Modern GnuTLS versions trust intermediate CA certificates by default.
+#endif /* TLS library */
+}
+
void
Security::PeerOptions::updateSessionOptions(Security::SessionPointer &s)
{
/// setup the CRL details for the given context
void updateContextCrl(Security::ContextPointer &);
+ /// decide which CAs to trust
+ void updateContextTrust(Security::ContextPointer &);
+
/// setup any library-specific options that can be set for the given session
void updateSessionOptions(Security::SessionPointer &);
}
updateContextCrl(ctx);
+ updateContextTrust(ctx);
} else {
debugs(83, 9, "Not requiring any client certificates");
Security::ContextPointer Security::PeerOptions::createBlankContext() const STUB_RETVAL(Security::ContextPointer())
void Security::PeerOptions::updateContextCa(Security::ContextPointer &) STUB
void Security::PeerOptions::updateContextCrl(Security::ContextPointer &) STUB
+void Security::PeerOptions::updateContextTrust(Security::ContextPointer &) STUB
void Security::PeerOptions::updateSessionOptions(Security::SessionPointer &) STUB
void Security::PeerOptions::dumpCfg(Packable*, char const*) const STUB
void Security::PeerOptions::parseOptions() STUB