File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,13 @@ json evaluate_testcase(const json &testcase)
112112
113113 X509_STORE_ptr store (X509_STORE_new (), X509_STORE_free);
114114 X509_STORE_set_flags (store.get (), X509_V_FLAG_X509_STRICT);
115+ // NOTE(ww): This flag is terribly named; it tells OpenSSL to
116+ // treat intermediate certificates in the root store as trust anchors,
117+ // which they already are (by virtue of being in the trust store).
118+ // This isn't the default for backwards compatibility reasons,
119+ // but it's consistent with how just about every other path building
120+ // implementation works.
121+ X509_STORE_set_flags (store.get (), X509_V_FLAG_PARTIAL_CHAIN);
115122 for (auto &cert : testcase[" trusted_certs" ])
116123 {
117124 auto cert_pem = cert.template get <std::string>();
@@ -141,6 +148,10 @@ json evaluate_testcase(const json &testcase)
141148 auto tm = std::chrono::system_clock::to_time_t (tp);
142149 X509_STORE_CTX_set_time (ctx.get (), 0 , tm);
143150 }
151+ else
152+ {
153+ X509_STORE_set_flags (store.get (), X509_V_FLAG_NO_CHECK_TIME);
154+ }
144155
145156 if (testcase[" expected_peer_name" ].is_object ())
146157 {
You can’t perform that action at this time.
0 commit comments